Skip to main content

RouteSpec

Trait RouteSpec 

Source
pub trait RouteSpec {
    type Kind;
    type Request: RouteRequestImpl<HeaderSlot = Self::HeaderSlot, RawHeaders = Self::RawHeaders, RawParams = Self::RawParams> + for<'req> RouteRequestImpl<Params<'req> = Self::Params<'req>, Headers<'req> = Self::Headers<'req>>;
    type Params<'req>: RouteParams<'req, Raw = Self::RawParams>;
    type RawParams: RawRouteParams<Captures = Self::Captures>;
    type Headers<'req>;
    type RawHeaders: Default;
    type HeaderSlot: Copy;
    type Response<'req>: Shape<'req>;
    type AsyncResponse: OwnedShape;
    type Stream: 'static;
    type ParsedBody<'req>;
    type Captures;
Show 6 associated constants and 2 methods const STATIC_RESPONSE: bool = false; const RESPONSE_BODY_KIND: ResponseKind = sark_core::http::body_kind::ResponseKind::Inline; const BODY_POLICY: BodyPolicy = <Self::Request as RouteRequestImpl>::BODY_POLICY; const MAX_BODY: usize = _; const EMIT_DATE: bool = true; const EMIT_SERVER: bool = true; // Required methods fn parse_body<'req>(raw: &'req [u8]) -> Result<Self::ParsedBody<'req>>; fn from_captures<P: PathProbe>( path: &P, captures: Self::Captures, ) -> Option<Self::RawParams>;
}

Provided Associated Constants§

Source

const STATIC_RESPONSE: bool = false

Source

const RESPONSE_BODY_KIND: ResponseKind = sark_core::http::body_kind::ResponseKind::Inline

Source

const BODY_POLICY: BodyPolicy = <Self::Request as RouteRequestImpl>::BODY_POLICY

Source

const MAX_BODY: usize = _

Source

const EMIT_DATE: bool = true

Source

const EMIT_SERVER: bool = true

Required Associated Types§

Source

type Kind

Source

type Request: RouteRequestImpl<HeaderSlot = Self::HeaderSlot, RawHeaders = Self::RawHeaders, RawParams = Self::RawParams> + for<'req> RouteRequestImpl<Params<'req> = Self::Params<'req>, Headers<'req> = Self::Headers<'req>>

Source

type Params<'req>: RouteParams<'req, Raw = Self::RawParams>

Source

type RawParams: RawRouteParams<Captures = Self::Captures>

Source

type Headers<'req>

Source

type RawHeaders: Default

Source

type HeaderSlot: Copy

Source

type Response<'req>: Shape<'req>

Source

type AsyncResponse: OwnedShape

Source

type Stream: 'static

Source

type ParsedBody<'req>

Source

type Captures

Required Methods§

Source

fn parse_body<'req>(raw: &'req [u8]) -> Result<Self::ParsedBody<'req>>

Source

fn from_captures<P: PathProbe>( path: &P, captures: Self::Captures, ) -> Option<Self::RawParams>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§