Skip to main content

AppMethod

Struct AppMethod 

Source
pub struct AppMethod<App, F, EP: ?Sized> {
    app: Rc<App>,
    f: F,
    phantom: PhantomData<EP>,
}
Expand description

An App together with a method on it. Used to pass Apps to actix_web::Handlers as first argument. See api::EndpointDetails::add_to.

Fields§

§app: Rc<App>§f: F§phantom: PhantomData<EP>

Implementations§

Source§

impl<App, F, EP: ?Sized> AppMethod<App, F, EP>

Source

pub fn new(app: &Rc<App>, f: F) -> Self

Creates a new AppMethod, cloning App.

Trait Implementations§

Source§

impl<App, F: Clone, EP> Clone for AppMethod<App, F, EP>

Implement Clone manually so we don’t have to require EP to implement Clone.

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Func, Fut, App, EP> Handler<()> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (): ()) -> Self::Future

Source§

impl<Func, Fut, App, EP, A> Handler<(A,)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A): (A,)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B> Handler<(A, B)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B): (A, B)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C> Handler<(A, B, C)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B, C): (A, B, C)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D> Handler<(A, B, C, D)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B, C, D): (A, B, C, D)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E> Handler<(A, B, C, D, E)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B, C, D, E): (A, B, C, D, E)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F> Handler<(A, B, C, D, E, F)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B, C, D, E, F): (A, B, C, D, E, F)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G> Handler<(A, B, C, D, E, F, G)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call(&self, (A, B, C, D, E, F, G): (A, B, C, D, E, F, G)) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H> Handler<(A, B, C, D, E, F, G, H)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H): (A, B, C, D, E, F, G, H), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I> Handler<(A, B, C, D, E, F, G, H, I)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I): (A, B, C, D, E, F, G, H, I), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J> Handler<(A, B, C, D, E, F, G, H, I, J)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J): (A, B, C, D, E, F, G, H, I, J), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K> Handler<(A, B, C, D, E, F, G, H, I, J, K)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K): (A, B, C, D, E, F, G, H, I, J, K), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K, L> Handler<(A, B, C, D, E, F, G, H, I, J, K, L)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K, L) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K, L): (A, B, C, D, E, F, G, H, I, J, K, L), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K, L, M> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K, L, M) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K, L, M): (A, B, C, D, E, F, G, H, I, J, K, L, M), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K, L, M, N> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K, L, M, N) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K, L, M, N): (A, B, C, D, E, F, G, H, I, J, K, L, M, N), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O): (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O), ) -> Self::Future

Source§

impl<Func, Fut, App, EP, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)> for AppMethod<App, Func, EP>
where Func: Fn(Rc<App>, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -> Fut + Clone + 'static, Fut: Future, App: 'static, EP: EndpointDetails + 'static, Fut::Output: Into<EP::ResponseType>,

Source§

type Output = Responder<EP>

Source§

type Future = Map<Fut, fn(<Fut as Future>::Output) -> Responder<EP>>

Source§

fn call( &self, (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P): (A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P), ) -> Self::Future

Auto Trait Implementations§

§

impl<App, F, EP> Freeze for AppMethod<App, F, EP>
where F: Freeze, EP: ?Sized,

§

impl<App, F, EP> RefUnwindSafe for AppMethod<App, F, EP>

§

impl<App, F, EP> !Send for AppMethod<App, F, EP>

§

impl<App, F, EP> !Sync for AppMethod<App, F, EP>

§

impl<App, F, EP> Unpin for AppMethod<App, F, EP>
where F: Unpin, EP: Unpin + ?Sized,

§

impl<App, F, EP> UnsafeUnpin for AppMethod<App, F, EP>
where F: UnsafeUnpin, EP: ?Sized,

§

impl<App, F, EP> UnwindSafe for AppMethod<App, F, EP>
where F: UnwindSafe, App: RefUnwindSafe, EP: UnwindSafe + ?Sized,

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V

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