Skip to main content

FnFutWrapper

Struct FnFutWrapper 

Source
pub struct FnFutWrapper<A, F>(/* private fields */);
Expand description

A wrapper for function/closures implementations.

Trait Implementations§

Source§

impl<A: Debug, F: Debug> Debug for FnFutWrapper<A, F>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<CA, E, F, S, SA, RES> Endpoint<CA, E, S, SA> for FnFutWrapper<(), F>
where E: From<Error>, F: FnFut<(), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, _: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, S, SA> Endpoint<CA, E, S, SA> for FnFutWrapper<(ManualStream<CA, S, SA>,), F>
where E: From<Error>, F: FnFut<(ManualStream<CA, S, SA>,), Result = Result<(), E>>,

Available on crate features http-server-framework and http only.
Source§

const OM: OperationMode = OperationMode::Manual

Operation mode
Source§

async fn manual( &self, manual_stream: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> Result<(), E>

Calls endpoint logic of manual streams
Source§

fn auto( &self, _: &mut AutoStream<CA, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<StatusCode, E>>

Calls endpoint logic of automatic streams
Source§

impl<CA, E, F, P, RES, S, SA> Endpoint<CA, E, S, SA> for FnFutWrapper<(PathOwned<P>,), F>
where E: From<Error>, P: FromStr, P::Err: Into<Error>, F: for<'any> FnFut<(PathOwned<P>,), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, path_defs: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, RES, S, SA> Endpoint<CA, E, S, SA> for FnFutWrapper<(PathStr<'_>,), F>
where E: From<Error>, F: for<'any> FnFut<(PathStr<'any>,), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, path_defs: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, RES, S, SA, T> Endpoint<CA, E, S, SA> for FnFutWrapper<(SerdeJsonOwned<T>,), F>
where E: From<Error>, F: FnFut<(SerdeJsonOwned<T>,), Result = RES>, RES: ResFinalizer<E>, T: DeserializeOwned,

Available on crate features serde_json and http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, _: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, RES, S, SA, const CLEAN: bool> Endpoint<CA, E, S, SA> for FnFutWrapper<(StateGeneric<'_, CA, SA, (&mut Vector<u8>, &mut Headers), CLEAN>, PathStr<'_>), F>
where E: From<Error>, F: for<'any> FnFut<(StateGeneric<'any, CA, SA, (&'any mut Vector<u8>, &'any mut Headers), CLEAN>, PathStr<'any>), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, path_defs: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, RES, S, SA, const CLEAN: bool> Endpoint<CA, E, S, SA> for FnFutWrapper<(StateGeneric<'_, CA, SA, ReqResBuffer, CLEAN>,), F>
where E: From<Error>, F: for<'any> FnFut<(StateGeneric<'any, CA, SA, ReqResBuffer, CLEAN>,), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, _: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, P, RES, S, SA, const CLEAN: bool> Endpoint<CA, E, S, SA> for FnFutWrapper<(StateGeneric<'_, CA, SA, ReqResBuffer, CLEAN>, PathOwned<P>), F>
where E: From<Error>, P: FromStr, P::Err: Into<Error>, F: for<'any> FnFut<(StateGeneric<'any, CA, SA, ReqResBuffer, CLEAN>, PathOwned<P>), Result = RES>, RES: ResFinalizer<E>,

Available on crate features http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, path_defs: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<CA, E, F, RES, S, SA, T, const CLEAN: bool> Endpoint<CA, E, S, SA> for FnFutWrapper<(StateGeneric<'_, CA, SA, ReqResBuffer, CLEAN>, SerdeJsonOwned<T>), F>
where E: From<Error>, F: for<'any> FnFut<(StateGeneric<'any, CA, SA, ReqResBuffer, CLEAN>, SerdeJsonOwned<T>), Result = RES>, RES: ResFinalizer<E>, T: DeserializeOwned,

Available on crate features serde_json and http-server-framework and http only.
Source§

async fn auto( &self, auto_stream: &mut AutoStream<CA, SA>, _: (u8, &[RouteMatch]), ) -> Result<StatusCode, E>

Calls endpoint logic of automatic streams
Source§

const OM: OperationMode = OperationMode::Auto

Operation mode
Source§

fn manual( &self, _: ManualStream<CA, S, SA>, _: (u8, &[RouteMatch]), ) -> impl Future<Output = Result<(), E>>

Calls endpoint logic of manual streams
Source§

impl<A, F> From<F> for FnFutWrapper<A, F>

Source§

fn from(from: F) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<A, F> Freeze for FnFutWrapper<A, F>
where F: Freeze,

§

impl<A, F> RefUnwindSafe for FnFutWrapper<A, F>

§

impl<A, F> Send for FnFutWrapper<A, F>
where F: Send, A: Send,

§

impl<A, F> Sync for FnFutWrapper<A, F>
where F: Sync, A: Sync,

§

impl<A, F> Unpin for FnFutWrapper<A, F>
where F: Unpin, A: Unpin,

§

impl<A, F> UnwindSafe for FnFutWrapper<A, F>
where F: UnwindSafe, A: 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<!> for T

Source§

fn from(t: !) -> T

Converts to this type from the input type.
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<T> Same for T

Source§

type Output = T

Should always be Self
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.
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