HyperHttpProtocol

Struct HyperHttpProtocol 

Source
pub struct HyperHttpProtocol { /* private fields */ }

Implementations§

Source§

impl HyperHttpProtocol

Source

pub async fn route( self, router: Arc<Router<Self>>, context_data: HashMap<String, Box<dyn Any + Send>>, ) -> Result<Response<BoxBody<Bytes, Infallible>>, Infallible>

Methods from Deref<Target = Meta<Request<Incoming>, Response<BoxBody<Bytes, Infallible>>>>§

Source

pub fn req(&self) -> Result<&Req, DceErr>

Source

pub fn req_mut(&mut self) -> &mut Option<Req>

Source

pub fn resp_mut(&mut self) -> &mut Option<Response<Resp>>

Source

pub fn heads(&self) -> &HashMap<String, String>

Source

pub fn resp_heads(&self) -> &HashMap<String, String>

Source

pub fn resp_heads_mut(&mut self) -> &mut HashMap<String, String>

Trait Implementations§

Source§

impl Debug for HyperHttpProtocol

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Deref for HyperHttpProtocol

Source§

type Target = Meta<Request<Incoming>, Response<BoxBody<Bytes, Infallible>>>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for HyperHttpProtocol

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl From<Request<Incoming>> for HyperHttpProtocol

Source§

fn from(value: Request<Incoming>) -> Self

Converts to this type from the input type.
Source§

impl HttpMethodGetter for HyperHttpProtocol

Source§

fn method(&self) -> &Method

Source§

impl HttpProtocol for HyperHttpProtocol

Source§

fn parse_http_method( prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>>, ) -> Option<Box<dyn DceMethod<Self> + Send + Sync>>

Source§

impl Into<Response<BoxBody<Bytes, Infallible>>> for HyperHttpProtocol

Source§

fn into(self) -> Response<BoxBody<Bytes, Infallible>>

Converts this type into the (usually inferred) input type.
Source§

impl RoutableProtocol for HyperHttpProtocol

Source§

type Req = Request<Incoming>

Source§

type Resp = Response<BoxBody<Bytes, Infallible>>

Source§

fn body<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = DceResult<Serialized>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn pack_resp(&self, serialized: Serialized) -> Self::Resp

Source§

fn path(&self) -> &str

Source§

fn handle_result( self, result: DceResult<()>, _: &mut Context<Self>, ) -> Option<Self::Resp>

Source§

fn parse_api_method( prop_mapping: &mut HashMap<&'static str, Box<dyn Any + Send + Sync>>, ) -> Option<Box<dyn DceMethod<Self> + Send + Sync>>

Source§

fn id(&self) -> Option<&str>

Source§

fn handle<'async_trait>( self, router: Arc<Router<Self>>, context_data: HashMap<String, Box<dyn Any + Send>>, ) -> Pin<Box<dyn Future<Output = Option<Self::Resp>> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Source§

fn api_match( &self, apis: &[&'static (dyn ApiTrait<Self> + Send + Sync)], ) -> Result<&'static (dyn ApiTrait<Self> + Send + Sync), DceErr>

Source§

fn deserializer<'a, ReqDto>( deserializers: &'a [Box<dyn Deserializer<ReqDto> + Send + Sync>], _context: &Context<Self>, ) -> Result<&'a Box<dyn Deserializer<ReqDto> + Send + Sync>, DceErr>

Source§

fn serializer<'a, RespDto>( serializers: &'a [Box<dyn Serializer<RespDto> + Send + Sync>], _context: &Context<Self>, ) -> Result<&'a Box<dyn Serializer<RespDto> + Send + Sync>, DceErr>

Source§

fn deserialize<ReqDto>( serializers: &[Box<dyn Deserializer<ReqDto> + Send + Sync>], seq: Serialized, context: &Context<Self>, ) -> Result<ReqDto, DceErr>

Source§

fn serialize<RespDto>( serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>], dto: Serializable<RespDto>, context: &Context<Self>, ) -> Result<Serialized, DceErr>

Source§

fn pack_responsible<RespDto>( context: &Context<Self>, serializers: &[Box<dyn Serializer<RespDto> + Send + Sync>], responsible: Serializable<RespDto>, ) -> Result<Option<Response<Self::Resp>>, DceErr>
where RespDto: 'static,

Source§

fn parse_api_method_and_extras( prop_tuples: Vec<(&'static str, Box<dyn Any + Send + Sync>)>, ) -> (Option<Box<dyn Method<Self> + Send + Sync>>, HashMap<&'static str, Box<dyn Any + Send + Sync>>)

Source§

fn try_print_err(response: &Result<(), DceErr>)

Source§

fn err_into(self, err: DceErr) -> Self::Resp

Auto Trait Implementations§

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.
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