FnSubscriptionBody

Trait FnSubscriptionBody 

Source
pub trait FnSubscriptionBody<Args>
where Args: FnSubscription, Args::Item: 'static, Args::Update: 'static,
{ type Output: Stream<Item = Args::Item> + Send; // Required method fn run( &self, updates: impl Stream<Item = Args::Update> + Send + 'static, args: Args, ) -> (Args::InitialReply, Self::Output); }
Expand description

An implementation of a subscription service.

You shouldn’t need to implement this, as a blanket implementation is provided for any async function or closure that takes a single FnSubscription argument and returns a stream of FnSubscription::Item.

Required Associated Types§

Source

type Output: Stream<Item = Args::Item> + Send

Required Methods§

Source

fn run( &self, updates: impl Stream<Item = Args::Update> + Send + 'static, args: Args, ) -> (Args::InitialReply, Self::Output)

Evaluate the function.

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.

Implementors§

Source§

impl<Args, Output, F> FnSubscriptionBody<Args> for F
where Args: FnSubscription, F: Fn(BoxStream<'static, Args::Update>, Args) -> (Args::InitialReply, Output), Output: Stream<Item = Args::Item> + Send, Args::Item: 'static, Args::Update: 'static,

Source§

type Output = Output