pub trait HostIncomingRequest {
// 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§
Sourcefn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>
fn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>
Returns the method of the incoming request.
Sourcefn path_with_query(
&mut self,
self_: Resource<IncomingRequest>,
) -> Result<Option<String>>
fn path_with_query( &mut self, self_: Resource<IncomingRequest>, ) -> Result<Option<String>>
Returns the path with query parameters from the request, as a string.
Sourcefn scheme(&mut self, self_: Resource<IncomingRequest>) -> Result<Option<Scheme>>
fn scheme(&mut self, self_: Resource<IncomingRequest>) -> Result<Option<Scheme>>
Returns the protocol scheme from the request.
Returns the authority of the Request’s target URI, if present.
Sourcefn headers(
&mut self,
self_: Resource<IncomingRequest>,
) -> Result<Resource<Headers>>
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.
Sourcefn consume(
&mut self,
self_: Resource<IncomingRequest>,
) -> Result<Result<Resource<IncomingBody>, ()>>
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.
fn drop(&mut self, rep: Resource<IncomingRequest>) -> Result<()>
Implementations on Foreign Types§
Source§impl<_T: HostIncomingRequest + ?Sized + Send> HostIncomingRequest for &mut _T
impl<_T: HostIncomingRequest + ?Sized + Send> HostIncomingRequest for &mut _T
Source§fn method(&mut self, self_: Resource<IncomingRequest>) -> Result<Method>
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>>
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>>
fn scheme(&mut self, self_: Resource<IncomingRequest>) -> Result<Option<Scheme>>
Returns the protocol scheme from the request.
Returns the authority of the Request’s target URI, if present.
Source§fn headers(
&mut self,
self_: Resource<IncomingRequest>,
) -> Result<Resource<Headers>>
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>, ()>>
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.