Skip to main content

Provision

Trait Provision 

Source
pub trait Provision: Send + Sync {
    // Required methods
    fn accepts(&self, runtime: &str, kind: &str) -> Result<(), ProvisionError>;
    fn provide(
        &self,
        kind: &str,
        bytes: &[u8],
    ) -> Result<Provisioned, ProvisionError>;
}
Expand description

Knows how to turn an artifact into a catalog.

Required Methods§

Source

fn accepts(&self, runtime: &str, kind: &str) -> Result<(), ProvisionError>

Whether a client that identifies itself this way — cpython-3.13/…, opaque here — can provision this worker with an artifact of this kind.

The kind matters: one carrying serialized objects demands that both sides look very much alike, one carrying names and state almost nothing.

Source

fn provide( &self, kind: &str, bytes: &[u8], ) -> Result<Provisioned, ProvisionError>

What this artifact yields.

Implementors§