pub struct OutgoingRequest { /* private fields */ }Expand description
Represents an outgoing HTTP Request.
Implementations§
Source§impl OutgoingRequest
impl OutgoingRequest
Sourcepub fn new(headers: Headers) -> Self
pub fn new(headers: Headers) -> Self
Construct a new outgoing-request with a default method of GET, and
none values for path-with-query, scheme, and authority.
headersis the HTTP Headers for the Request.
It is possible to construct, or manipulate with the accessor functions
below, an outgoing-request with an invalid combination of scheme
and authority, or headers which are not permitted to be sent.
It is the obligation of the outgoing-handler.handle implementation
to reject invalid constructions of outgoing-request.
Source§impl OutgoingRequest
impl OutgoingRequest
Sourcepub fn body(&self) -> Result<OutgoingBody, ()>
pub fn body(&self) -> Result<OutgoingBody, ()>
Returns the resource corresponding to the outgoing Body for this Request.
Returns success on the first call: the outgoing-body resource for
this outgoing-request can be retrieved at most once. Subsequent
calls will return error.
Source§impl OutgoingRequest
impl OutgoingRequest
Sourcepub fn path_with_query(&self) -> Option<String>
pub fn path_with_query(&self) -> Option<String>
Get the combination of the HTTP Path and Query for the Request.
When none, this represents an empty Path and empty Query.
Source§impl OutgoingRequest
impl OutgoingRequest
Get the HTTP Authority for the Request. A value of none may be used
with Related Schemes which do not require an Authority. The HTTP and
HTTPS schemes always require an authority.
Source§impl OutgoingRequest
impl OutgoingRequest
Set the HTTP Authority for the Request. A value of none may be used
with Related Schemes which do not require an Authority. The HTTP and
HTTPS schemes always require an authority. Fails if the string given is
not a syntactically valid uri authority.
Source§impl OutgoingRequest
impl OutgoingRequest
Sourcepub fn headers(&self) -> Headers
pub fn headers(&self) -> 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.
This headers resource is a child: it must be dropped before the parent
outgoing-request is dropped, or its ownership is transfered to
another component by e.g. outgoing-handler.handle.
Trait Implementations§
Source§impl Debug for OutgoingRequest
impl Debug for OutgoingRequest
Source§impl TryIntoOutgoingRequest for OutgoingRequest
impl TryIntoOutgoingRequest for OutgoingRequest
Source§type Error = Infallible
type Error = Infallible
Source§fn try_into_outgoing_request(
self,
) -> Result<(OutgoingRequest, Option<Vec<u8>>), Self::Error>
fn try_into_outgoing_request( self, ) -> Result<(OutgoingRequest, Option<Vec<u8>>), Self::Error>
OutgoingRequest Read more