Skip to main content

BackendConfig

Trait BackendConfig 

Source
pub trait BackendConfig {
    type Args;
    type Id;
    type Kind;
    type Config;
    type Layer;

    // Required methods
    fn config(&self) -> &Self::Config;
    fn middleware(&mut self, worker: &mut WorkerContext) -> Self::Layer;
}
Expand description

Decorates a backend with middleware, configuration and associated types

Required Associated Types§

Source

type Args

The type of argument this backend emits

Source

type Id

The internal type of this Backend’s TaskId

Source

type Kind

This defines the kind of Backend

Source

type Config

The config for the backend

Source

type Layer

The type representing backend middleware layer.

Required Methods§

Source

fn config(&self) -> &Self::Config

Returns the config associated with the backend.

Source

fn middleware(&mut self, worker: &mut WorkerContext) -> Self::Layer

Returns the backend’s middleware layer.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<B: BackendConfig> BackendConfig for &mut B

Source§

type Args = <B as BackendConfig>::Args

Source§

type Kind = <B as BackendConfig>::Kind

Source§

type Id = <B as BackendConfig>::Id

Source§

type Config = <B as BackendConfig>::Config

Source§

type Layer = <B as BackendConfig>::Layer

Source§

fn config(&self) -> &Self::Config

Source§

fn middleware(&mut self, worker: &mut WorkerContext) -> Self::Layer

Source§

impl<T, E> BackendConfig for BoxStream<'_, Result<T, E>>
where E: Error + Send + Sync + 'static,

Source§

type Args = T

Source§

type Kind = Ephemeral

Source§

type Id = RandomId

Source§

type Config = ()

Source§

type Layer = Identity

Source§

fn config(&self) -> &Self::Config

Source§

fn middleware(&mut self, _worker: &mut WorkerContext) -> Self::Layer

Implementors§

Source§

impl<Args, DB, Fetch, S, Config, E> BackendConfig for CustomBackend<Args, DB, Fetch, S, Config>
where Fetch: Stream<Item = Result<Option<Task<Args>>, E>> + Unpin + Send + 'static, S: Sink<Task<Args>, Error = E> + Unpin + Send + 'static, E: Into<BoxDynError>, Args: 'static,

Source§

impl<Args> BackendConfig for MemoryStorage<Args>

Source§

impl<Args> BackendConfig for VecDequeBackend<Args>

Source§

impl<B, Args> BackendConfig for DurableBackend<B, Args>
where B: BackendConfig,

Source§

impl<B, E> BackendConfig for BeforeStart<B, E>
where B: BackendConfig,

Source§

impl<B, F> BackendConfig for InspectErr<B, F>
where B: BackendConfig,

Source§

impl<B, F> BackendConfig for MapErr<B, F>
where B: BackendConfig,

Source§

impl<B, FutErr> BackendConfig for AfterStart<B, FutErr>
where B: BackendConfig,

Source§

impl<B, FutErr> BackendConfig for AfterStop<B, FutErr>
where B: BackendConfig,

Source§

impl<B, FutErr> BackendConfig for BeforeStop<B, FutErr>
where B: BackendConfig,

Source§

impl<B, NewCodec> BackendConfig for WithCodec<B, NewCodec>
where B: BackendConfig,

Source§

impl<B, S> BackendConfig for Interleave<B, S>
where B: BackendConfig,

Source§

impl<B, S> BackendConfig for PollWith<B, S>
where B: BackendConfig,

Source§

impl<B> BackendConfig for Instrumented<B>
where B: BackendConfig,

Available on crate feature tracing only.
Source§

impl<B> BackendConfig for Shared<B>

Available on crate feature shared only.
Source§

impl<B> BackendConfig for WakeOnPush<B>
where B: BackendConfig,

Source§

impl<Dst, S> BackendConfig for Pipe<Dst, S>
where Dst: BackendConfig,