Trait SpawnWorkflowExt

Source
pub trait SpawnWorkflowExt {
    // Required method
    fn spawn_workflow<Request, Response, Streams, W>(
        &mut self,
        build: impl FnOnce(Scope<Request, Response, Streams>, &mut Builder<'_, '_, '_>) -> W,
    ) -> Service<Request, Response, Streams>
       where Request: 'static + Send + Sync,
             Response: 'static + Send + Sync,
             Streams: StreamPack,
             W: Into<WorkflowSettings>;

    // Provided method
    fn spawn_io_workflow<Request, Response, W>(
        &mut self,
        build: impl FnOnce(Scope<Request, Response>, &mut Builder<'_, '_, '_>) -> W,
    ) -> Service<Request, Response>
       where Request: 'static + Send + Sync,
             Response: 'static + Send + Sync,
             W: Into<WorkflowSettings> { ... }
}
Expand description

Trait to allow workflows to be spawned from a Commands or a World.

Required Methods§

Source

fn spawn_workflow<Request, Response, Streams, W>( &mut self, build: impl FnOnce(Scope<Request, Response, Streams>, &mut Builder<'_, '_, '_>) -> W, ) -> Service<Request, Response, Streams>
where Request: 'static + Send + Sync, Response: 'static + Send + Sync, Streams: StreamPack, W: Into<WorkflowSettings>,

Spawn a workflow.

  • build - A function that takes in a Scope and a Builder to build the workflow

If you want any particular settings for your workflow, specify that with the return value of build. Returning nothing () will use default workflow settings.

Provided Methods§

Source

fn spawn_io_workflow<Request, Response, W>( &mut self, build: impl FnOnce(Scope<Request, Response>, &mut Builder<'_, '_, '_>) -> W, ) -> Service<Request, Response>
where Request: 'static + Send + Sync, Response: 'static + Send + Sync, W: Into<WorkflowSettings>,

Spawn a pure input/output (io) workflow with no streams. This is just a convenience wrapper around spawn_workflow which usually allows you to avoid specifying any generic parameters when there are no streams being used.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl SpawnWorkflowExt for World

Source§

fn spawn_workflow<Request, Response, Streams, W>( &mut self, build: impl FnOnce(Scope<Request, Response, Streams>, &mut Builder<'_, '_, '_>) -> W, ) -> Service<Request, Response, Streams>
where Request: 'static + Send + Sync, Response: 'static + Send + Sync, Streams: StreamPack, W: Into<WorkflowSettings>,

Implementors§

Source§

impl<'w, 's> SpawnWorkflowExt for Commands<'w, 's>