QueueFn

Struct QueueFn 

Source
pub struct QueueFn<I, O, F = fn(Result<&I, Error>) -> Option<Result<O, Error>>>
where I: ReadRequest + ?Sized, O: Send, F: FnMut(Result<&I, Error>) -> Option<Result<O, Error>> + Send,
{ /* private fields */ }
Expand description

Subscription queue that stores all received values, applying F to them.

If F returned None the value is filtered out.

Trait Implementations§

Source§

impl<I, O, F> Queue for QueueFn<I, O, F>
where I: ReadRequest + ?Sized, O: Send, F: FnMut(Result<&I, Error>) -> Option<Result<O, Error>> + Send,

Source§

type Request = I

Source§

type Output = O

Source§

fn push(&mut self, input: Result<&Self::Request, Error>)

Called immediately on channel updates.
Source§

fn pop(&mut self) -> Option<Result<Self::Output, Error>>

Called when user tries to extract data from Subscription stream.

Auto Trait Implementations§

§

impl<I, O, F> Freeze for QueueFn<I, O, F>
where F: Freeze, I: ?Sized,

§

impl<I, O, F> RefUnwindSafe for QueueFn<I, O, F>

§

impl<I, O, F> Send for QueueFn<I, O, F>
where I: ?Sized,

§

impl<I, O, F> Sync for QueueFn<I, O, F>
where F: Sync, I: Sync + ?Sized, O: Sync,

§

impl<I, O, F> Unpin for QueueFn<I, O, F>
where F: Unpin, I: Unpin + ?Sized, O: Unpin,

§

impl<I, O, F> UnwindSafe for QueueFn<I, O, F>
where F: UnwindSafe, I: UnwindSafe + ?Sized, O: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.