Skip to main content

Decode

Trait Decode 

Source
pub trait Decode {
    type Prepared: Prepared;
    type Routes: Family<Self::Prepared>;
    type Head: Head<Prepared = Self::Prepared, Start: Selection<Self::Prepared, Guard = Self::Routes, Routed = <Self::Routes as Family<Self::Prepared>>::State<Routed>>>;
    type Plan: Policy;
    type Cause;
    type Error<'req>;
    type Projected<'req, 'd>
       where 'd: 'req;
    type Egress<'d>: Bound;

    // Required methods
    fn reject<'req>(error: Self::Error<'req>) -> Reject;
    fn try_full(
        &self,
        head: RetainedHead<Decoded, Selected<RetainRaw>>,
    ) -> Result<Self::Head, HeadError<Self::Cause>>;
    fn try_head(
        &self,
        head: RetainedHead<<Self::Plan as Policy>::Block, Selected<Self::Plan>>,
    ) -> Result<Self::Head, HeadError<Self::Cause>>;
    fn try_project<'d, I, T, F>(
        &self,
        prepared: Self::Prepared,
        body: Input<I>,
        project: F,
    ) -> Projection<T, I::Owner, (Self::Prepared, Input<I>)>
       where I: Project<'d>,
             F: for<'req> FnOnce(Scoped<'req, 'd, Self, I::Proof>) -> T;
    fn try_dispatch<'req, 'd, E: Encode<'req, 'd>>(
        &self,
        request: Self::Projected<'req, 'd>,
        encoder: E,
    ) -> Result<<E as Encode<'req, 'd>>::Prepared, (Error<<E as Encode<'req, 'd>>::Error, Infallible, Self::Error<'req>>, <E as Cancel>::Target)>
       where 'd: 'req;
}

Required Associated Types§

Source

type Prepared: Prepared

Source

type Routes: Family<Self::Prepared>

Source

type Head: Head<Prepared = Self::Prepared, Start: Selection<Self::Prepared, Guard = Self::Routes, Routed = <Self::Routes as Family<Self::Prepared>>::State<Routed>>>

Source

type Plan: Policy

Source

type Cause

Source

type Error<'req>

Source

type Projected<'req, 'd>
where 'd: 'req,

Source

type Egress<'d>: Bound

Response backing bound; executable adapters require it to outlive their driver.

Required Methods§

Source

fn reject<'req>(error: Self::Error<'req>) -> Reject

Source

fn try_full( &self, head: RetainedHead<Decoded, Selected<RetainRaw>>, ) -> Result<Self::Head, HeadError<Self::Cause>>

Routes an admitted request while retaining every decoded field.

Source

fn try_head( &self, head: RetainedHead<<Self::Plan as Policy>::Block, Selected<Self::Plan>>, ) -> Result<Self::Head, HeadError<Self::Cause>>

Source

fn try_project<'d, I, T, F>( &self, prepared: Self::Prepared, body: Input<I>, project: F, ) -> Projection<T, I::Owner, (Self::Prepared, Input<I>)>
where I: Project<'d>, F: for<'req> FnOnce(Scoped<'req, 'd, Self, I::Proof>) -> T,

Source

fn try_dispatch<'req, 'd, E: Encode<'req, 'd>>( &self, request: Self::Projected<'req, 'd>, encoder: E, ) -> Result<<E as Encode<'req, 'd>>::Prepared, (Error<<E as Encode<'req, 'd>>::Error, Infallible, Self::Error<'req>>, <E as Cancel>::Target)>
where 'd: 'req,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§