Skip to main content

ProvideOnce

Trait ProvideOnce 

Source
pub trait ProvideOnce {
    type Request;
    type Response;
    type Streams;

    // Required method
    fn connect(
        self,
        scope: Option<Entity>,
        source: Entity,
        target: Entity,
        commands: &mut Commands<'_, '_>,
    );
}
Expand description

Similar to Provider but can be used for functions that are only able to run once, e.g. that use FnOnce. Because of this, ProvideOnce is suitable for a series, but not for workflows.

Required Associated Types§

Required Methods§

Source

fn connect( self, scope: Option<Entity>, source: Entity, target: Entity, commands: &mut Commands<'_, '_>, )

Take a request from a source (stream target information will also be extracted from the source) and connect it to a target.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<Def, Request, Response, Streams> ProvideOnce for BlockingMapDef<Def, Request, Response, Streams>
where Def: CallBlockingMap<Request, Response, Streams> + 'static + Send + Sync, Request: 'static + Send + Sync, Response: 'static + Send + Sync, Streams: StreamPack,

Source§

type Request = Request

Source§

type Response = Response

Source§

type Streams = Streams

Source§

impl<Def, Request, Response, Streams> ProvideOnce for BlockingMapOnceDef<Def, Request, Response, Streams>
where Def: CallBlockingMapOnce<Request, Response, Streams> + 'static + Send + Sync, Request: 'static + Send + Sync, Response: 'static + Send + Sync, Streams: StreamPack,

Source§

type Request = Request

Source§

type Response = Response

Source§

type Streams = ()

Source§

impl<Def, Request, Task, Streams> ProvideOnce for AsyncMapDef<Def, Request, Task, Streams>
where Def: CallAsyncMap<Request, Task, Streams> + 'static + Send + Sync, Task: Future + 'static + Sendish, Request: 'static + Send + Sync, Task::Output: 'static + Send + Sync, Streams: StreamPack,

Source§

type Request = Request

Source§

type Response = <Task as Future>::Output

Source§

type Streams = Streams

Source§

impl<Def, Request, Task, Streams> ProvideOnce for AsyncMapOnceDef<Def, Request, Task, Streams>
where Def: CallAsyncMapOnce<Request, Task, Streams> + 'static + Send + Sync, Task: Future + 'static + Sendish, Request: 'static + Send + Sync, Task::Output: 'static + Send + Sync, Streams: StreamPack,

Source§

type Request = Request

Source§

type Response = <Task as Future>::Output

Source§

type Streams = Streams

Source§

impl<Request, Response, Streams> ProvideOnce for Callback<Request, Response, Streams>
where Request: 'static + Send + Sync, Response: 'static + Send + Sync, Streams: StreamPack,

Source§

type Request = Request

Source§

type Response = Response

Source§

type Streams = Streams

Source§

impl<Request, Response, Streams> ProvideOnce for Service<Request, Response, Streams>
where Request: 'static + Send + Sync,

Source§

type Request = Request

Source§

type Response = Response

Source§

type Streams = Streams

Source§

impl<Request, Response, Streams> ProvideOnce for ServiceInstructions<Request, Response, Streams>
where Request: 'static + Send + Sync,

Source§

type Request = Request

Source§

type Response = Response

Source§

type Streams = Streams