Trait finchers_core::Endpoint
[−]
[src]
pub trait Endpoint: Send + Sync { type Output; type Task: Task<Output = Self::Output>; fn apply(&self, cx: &mut Context) -> Option<Self::Task>; fn apply_request(
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task> { ... } }
Trait representing an endpoint.
Associated Types
type Output
The inner type associated with this endpoint.
type Task: Task<Output = Self::Output>
The type of value which will be returned from apply
.
Required Methods
fn apply(&self, cx: &mut Context) -> Option<Self::Task>
Perform checking the incoming HTTP request and returns an instance of the associated task if matched.
Provided Methods
fn apply_request(
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
Create an asyncrhonous computation from a request.
Implementations on Foreign Types
impl<'a, E: Endpoint> Endpoint for &'a E
[src]
type Output = E::Output
type Task = E::Task
fn apply(&self, cx: &mut Context) -> Option<Self::Task>
[src]
fn apply_request(
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
[src]
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
impl<E: Endpoint> Endpoint for Box<E>
[src]
type Output = E::Output
type Task = E::Task
fn apply(&self, cx: &mut Context) -> Option<Self::Task>
[src]
fn apply_request(
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
[src]
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
impl<E: Endpoint> Endpoint for Arc<E>
[src]
type Output = E::Output
type Task = E::Task
fn apply(&self, cx: &mut Context) -> Option<Self::Task>
[src]
fn apply_request(
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>
[src]
&self,
input: &Input,
body: RequestBody
) -> ApplyRequest<Self::Task>