pub struct SessionRequest(/* private fields */);Expand description
A CONNECT WebTransport request.
Implementations§
Source§impl SessionRequest
impl SessionRequest
Sourcepub const RESERVED_HEADERS: &'static [&'static str]
pub const RESERVED_HEADERS: &'static [&'static str]
A collection of reserved headers used in the WebTransport protocol.
Reserved headers have special significance in the WebTransport protocol and
cannot be used as additional headers with the insert method.
The following headers are considered reserved:
:method:scheme:protocol:authority:path
Sourcepub fn new<S>(url: S) -> Result<Self, UrlParseError>
pub fn new<S>(url: S) -> Result<Self, UrlParseError>
Parses an URL to build a Session request.
Returns the :authority field of the request.
Sourcepub fn user_agent(&self) -> Option<&str>
pub fn user_agent(&self) -> Option<&str>
Returns the user-agent field of the request if present.
Sourcepub fn insert<K, V>(&mut self, key: K, value: V) -> Result<(), ReservedHeader>
pub fn insert<K, V>(&mut self, key: K, value: V) -> Result<(), ReservedHeader>
Inserts a key-value pair into the header map, checking for reserved headers.
This method inserts a key-value pair into the header map after ensuring that
the specified key is not one of the reserved headers.
If the key is reserved, the method returns an Err(ReservedHeader) indicating
the attempt to insert a value for a reserved header.
If the key already exists in the header map, the corresponding value is updated with the new value.