Struct FromFnLayer

#[must_use]
pub struct FromFnLayer<F, S, T> { /* private fields */ }

A tower::Layer from an async function.

tower::Layer is used to apply middleware to Router's.

Created with from_fn or from_fn_with_state. See those functions for more details.

Trait Implementations

impl<F, S, T> Clone for FromFnLayer<F, S, T> where F: Clone, S: Clone,

fn clone(&self) -> Self

impl<F, S, T> Debug for FromFnLayer<F, S, T> where S: Debug,

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

impl<S, I, F, T> Layer<I> for FromFnLayer<F, S, T> where F: Clone, S: Clone,

type Service = FromFn<F, S, I, T>;
fn layer(&self, inner: I) -> Self::Service

Auto Trait Implementations

impl<F, S, T> Freeze for FromFnLayer<F, S, T> where F: Freeze, S: Freeze, PhantomData<fn() -> T>: Freeze,

impl<F, S, T> RefUnwindSafe for FromFnLayer<F, S, T> where F: RefUnwindSafe, S: RefUnwindSafe, PhantomData<fn() -> T>: RefUnwindSafe,

impl<F, S, T> Send for FromFnLayer<F, S, T> where F: Send, S: Send, PhantomData<fn() -> T>: Send,

impl<F, S, T> Sync for FromFnLayer<F, S, T> where F: Sync, S: Sync, PhantomData<fn() -> T>: Sync,

impl<F, S, T> Unpin for FromFnLayer<F, S, T> where F: Unpin, S: Unpin, PhantomData<fn() -> T>: Unpin,

impl<F, S, T> UnsafeUnpin for FromFnLayer<F, S, T> where F: UnsafeUnpin, S: UnsafeUnpin, PhantomData<fn() -> T>: UnsafeUnpin,

impl<F, S, T> UnwindSafe for FromFnLayer<F, S, T> where F: UnwindSafe, S: UnwindSafe, PhantomData<fn() -> T>: UnwindSafe,

Blanket Implementations

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for FromFnLayer<F, S, T> where ST: ?Sized, DT: ?Sized,

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for FromFnLayer<F, S, T> where ST: ?Sized, DT: ?Sized,

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

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for FromFnLayer<F, S, T> where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for FromFnLayer<F, S, T> where T: ?Sized,

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

impl<T> CloneToUninit for FromFnLayer<F, S, T> where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for FromFnLayer<F, S, T>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> FromRef<T> for FromFnLayer<F, S, T> where T: Clone,

fn from_ref(input: &T) -> T

impl<T> Instrument for FromFnLayer<F, S, T>

impl<T> Read<Exclusive, BecauseExclusive> for FromFnLayer<F, S, T> where T: ?Sized,

impl<T> Same for FromFnLayer<F, S, T>

type Output = T;

impl<T> ToOwned for FromFnLayer<F, S, T> where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T> WithSubscriber for FromFnLayer<F, S, T>

impl<T, U> Into<U> for FromFnLayer<F, S, T> where U: From<T>,

fn into(self) -> U

Calls U::from(self).

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

impl<T, U> TryFrom<U> for FromFnLayer<F, S, T> where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for FromFnLayer<F, S, T> where U: TryFrom<T>,

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

impl<V, T> VZip<V> for FromFnLayer<F, S, T> where V: MultiLane<T>,

fn vzip(self) -> V