Struct s2n_quic::provider::event::query::Once

source ·
pub struct Once<F, Context, Outcome> { /* private fields */ }
Expand description

A type that implements Query and QueryMut traits and only executes once.

This will execute and short-circuit on the first match.

Implementations§

source§

impl<F, ConnectionContext, Outcome> Once<F, ConnectionContext, Outcome>
where F: FnOnce(&ConnectionContext) -> Outcome, ConnectionContext: 'static,

source

pub fn new(query: F) -> Once<F, ConnectionContext, Outcome>

source§

impl<F, ConnectionContext, Outcome> Once<F, ConnectionContext, Outcome>
where F: FnOnce(&mut ConnectionContext) -> Outcome, ConnectionContext: 'static,

source

pub fn new_mut(query: F) -> Once<F, ConnectionContext, Outcome>

Trait Implementations§

source§

impl<F, Context, Outcome> From<Once<F, Context, Outcome>> for Result<Outcome, Error>

source§

fn from(query: Once<F, Context, Outcome>) -> Result<Outcome, Error>

Converts to this type from the input type.
source§

impl<F, Context, Outcome> Query for Once<F, Context, Outcome>
where F: FnOnce(&Context) -> Outcome, Context: 'static,

source§

fn execute(&mut self, context: &(dyn Any + 'static)) -> ControlFlow

source§

impl<F, Context, Outcome> QueryMut for Once<F, Context, Outcome>
where F: FnOnce(&mut Context) -> Outcome, Context: 'static,

source§

fn execute_mut(&mut self, context: &mut (dyn Any + 'static)) -> ControlFlow

Auto Trait Implementations§

§

impl<F, Context, Outcome> Freeze for Once<F, Context, Outcome>
where F: Freeze, Outcome: Freeze,

§

impl<F, Context, Outcome> RefUnwindSafe for Once<F, Context, Outcome>
where F: RefUnwindSafe, Outcome: RefUnwindSafe, Context: RefUnwindSafe,

§

impl<F, Context, Outcome> Send for Once<F, Context, Outcome>
where F: Send, Outcome: Send, Context: Send,

§

impl<F, Context, Outcome> Sync for Once<F, Context, Outcome>
where F: Sync, Outcome: Sync, Context: Sync,

§

impl<F, Context, Outcome> Unpin for Once<F, Context, Outcome>
where F: Unpin, Outcome: Unpin, Context: Unpin,

§

impl<F, Context, Outcome> UnwindSafe for Once<F, Context, Outcome>
where F: UnwindSafe, Outcome: UnwindSafe, Context: 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>,

§

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>,

§

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, U> Upcast<T> for U
where T: UpcastFrom<U>,

source§

fn upcast(self) -> T

source§

impl<T, B> UpcastFrom<Counter<T, B>> for T

source§

fn upcast_from(value: Counter<T, B>) -> T

source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V