Trait wasmcloud_runtime::capability::http::types::HostIncomingRequest
source · pub trait HostIncomingRequest {
// Required methods
fn method(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Method, Error>;
fn path_with_query(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<String>, Error>;
fn scheme(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<Scheme>, Error>;
fn authority(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<String>, Error>;
fn headers(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Resource<HostFields>, Error>;
fn consume(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Result<Resource<HostIncomingBody>, ()>, Error>;
fn drop(&mut self, rep: Resource<HostIncomingRequest>) -> Result<(), Error>;
}
Required Methods§
sourcefn method(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Method, Error>
fn method( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Method, Error>
Returns the method of the incoming request.
sourcefn path_with_query(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<String>, Error>
fn path_with_query( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Option<String>, Error>
Returns the path with query parameters from the request, as a string.
sourcefn scheme(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<Scheme>, Error>
fn scheme( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Option<Scheme>, Error>
Returns the protocol scheme from the request.
Returns the authority of the Request’s target URI, if present.
sourcefn headers(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Resource<HostFields>, Error>
fn headers( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Resource<HostFields>, Error>
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<HostIncomingRequest>,
) -> Result<Result<Resource<HostIncomingBody>, ()>, Error>
fn consume( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Result<Resource<HostIncomingBody>, ()>, Error>
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<HostIncomingRequest>) -> Result<(), Error>
Implementations on Foreign Types§
source§impl<_T> HostIncomingRequest for &mut _T
impl<_T> HostIncomingRequest for &mut _T
source§fn method(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Method, Error>
fn method( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Method, Error>
Returns the method of the incoming request.
source§fn path_with_query(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<String>, Error>
fn path_with_query( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Option<String>, Error>
Returns the path with query parameters from the request, as a string.
source§fn scheme(
&mut self,
self_: Resource<HostIncomingRequest>,
) -> Result<Option<Scheme>, Error>
fn scheme( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Option<Scheme>, Error>
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<HostIncomingRequest>,
) -> Result<Resource<HostFields>, Error>
fn headers( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Resource<HostFields>, Error>
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<HostIncomingRequest>,
) -> Result<Result<Resource<HostIncomingBody>, ()>, Error>
fn consume( &mut self, self_: Resource<HostIncomingRequest>, ) -> Result<Result<Resource<HostIncomingBody>, ()>, Error>
Gives the incoming-body
associated with this request. Will only
return success at most once, and subsequent calls will return error.