Trait HostIncomingRequest

Source
pub trait HostIncomingRequest: Sized + Send {
    // Required methods
    fn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>;
    fn path_with_query(
        &mut self,
        self_: Resource<IncomingRequest>,
    ) -> Result<Option<String>>;
    fn scheme(
        &mut self,
        self_: Resource<IncomingRequest>,
    ) -> Result<Option<Scheme>>;
    fn authority(
        &mut self,
        self_: Resource<IncomingRequest>,
    ) -> Result<Option<String>>;
    fn headers(
        &mut self,
        self_: Resource<IncomingRequest>,
    ) -> Result<Resource<Headers>>;
    fn consume(
        &mut self,
        self_: Resource<IncomingRequest>,
    ) -> Result<Result<Resource<IncomingBody>, ()>>;
    fn drop(&mut self, rep: Resource<IncomingRequest>) -> Result<()>;
}

Required Methods§

Source

fn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>

Returns the method of the incoming request.

Source

fn path_with_query( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Option<String>>

Returns the path with query parameters from the request, as a string.

Source

fn scheme(&mut self, self_: Resource<IncomingRequest>) -> Result<Option<Scheme>>

Returns the protocol scheme from the request.

Source

fn authority( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Option<String>>

Returns the authority of the Request’s target URI, if present.

Source

fn headers( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Resource<Headers>>

Get the headers associated with the request.

The returned headers resource is immutable: set, append, and delete operations will fail with header-error.immutable.

The headers returned are a child resource: it must be dropped before the parent incoming-request is dropped. Dropping this incoming-request before all children are dropped will trap.

Source

fn consume( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Result<Resource<IncomingBody>, ()>>

Gives the incoming-body associated with this request. Will only return success at most once, and subsequent calls will return error.

Source

fn drop(&mut self, rep: Resource<IncomingRequest>) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<_T: HostIncomingRequest + ?Sized + Send> HostIncomingRequest for &mut _T

Source§

fn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>

Returns the method of the incoming request.

Source§

fn path_with_query( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Option<String>>

Returns the path with query parameters from the request, as a string.

Source§

fn scheme(&mut self, self_: Resource<IncomingRequest>) -> Result<Option<Scheme>>

Returns the protocol scheme from the request.

Source§

fn authority( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Option<String>>

Returns the authority of the Request’s target URI, if present.

Source§

fn headers( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Resource<Headers>>

Get the headers associated with the request.

The returned headers resource is immutable: set, append, and delete operations will fail with header-error.immutable.

The headers returned are a child resource: it must be dropped before the parent incoming-request is dropped. Dropping this incoming-request before all children are dropped will trap.

Source§

fn consume( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Result<Resource<IncomingBody>, ()>>

Gives the incoming-body associated with this request. Will only return success at most once, and subsequent calls will return error.

Source§

fn drop(&mut self, rep: Resource<IncomingRequest>) -> Result<()>

Implementors§