Skip to main content

Demand

Struct Demand 

Source
pub struct Demand<S, G = AlwaysArmed> { /* private fields */ }
Expand description

A SendPipe gated by downstream DemandGate: dormant (no-op Ok) when the gate is closed, the inner pipe when open.

Implementations§

Source§

impl<S, G> Demand<S, G>

Source

pub fn new(inner: S, gate: G) -> Self

Gate inner behind gate.

Source

pub fn is_armed(&self) -> bool
where G: DemandGate,

Whether the gate is currently open.

Trait Implementations§

Source§

impl<S, G> SendPipe for Demand<S, G>
where S: SendPipe, S::In: Send, G: DemandGate,

Source§

type In = <S as SendPipe>::In

Input the pipe consumes.
Source§

type Out = ()

Output the pipe produces.
Source§

type Err = <S as SendPipe>::Err

Error the pipe can fail with — Send here so it can cross cores.
Source§

fn call(&self, item: S::In) -> impl Future<Output = Result<(), S::Err>> + Send

Apply the pipe. The returned future IS Send.

Auto Trait Implementations§

§

impl<S, G> Freeze for Demand<S, G>
where S: Freeze, G: Freeze,

§

impl<S, G> RefUnwindSafe for Demand<S, G>

§

impl<S, G> Send for Demand<S, G>
where S: Send, G: Send,

§

impl<S, G> Sync for Demand<S, G>
where S: Sync, G: Sync,

§

impl<S, G> Unpin for Demand<S, G>
where S: Unpin, G: Unpin,

§

impl<S, G> UnsafeUnpin for Demand<S, G>
where S: UnsafeUnpin, G: UnsafeUnpin,

§

impl<S, G> UnwindSafe for Demand<S, G>
where S: UnwindSafe, G: 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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<P> SendDynPipe<<P as SendPipe>::In, <P as SendPipe>::Out> for P
where P: SendPipe, <P as SendPipe>::In: Send, ProximaError: From<<P as SendPipe>::Err>,

Source§

fn call_dyn( &self, input: <P as SendPipe>::In, ) -> Pin<Box<dyn Future<Output = Result<<P as SendPipe>::Out, ProximaError>> + Send + '_>>

Erased dispatch — boxes the inner pipe’s Send future and converts its error into ProximaError.
Source§

impl<Implementor> SourcePipe for Implementor
where Implementor: SendPipe<In = Signal, Out = (), Err = ProximaError>,

Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more