pub struct Request {
pub method: Method,
pub uri: Uri,
pub version: Version,
pub headers: Headers,
/* private fields */
}Expand description
A parsed request.
Fields§
§method: MethodThe method.
uri: UriThe Request-URI.
Use Request::set_uri to mutate this value. Assigning the field directly cannot update
the parser-retained start-line span and would replay stale wire bytes.
version: VersionThe protocol version.
headers: HeadersThe headers, in wire order.
Implementations§
Source§impl Request
impl Request
Sourcepub fn set_uri(&mut self, uri: Uri) -> Result<(), UriError>
pub fn set_uri(&mut self, uri: Uri) -> Result<(), UriError>
Replace the Request-URI without rebuilding a parsed start line.
Retargeting logic must use this rather than assigning the public field directly. For a parsed request, only the parser-owned URI span changes; method spelling, separators and SIP-version bytes stay exact. Constructed requests retain deterministic serialization. The replacement is validated from its serialized bytes before either representation is changed, so a failure is atomic.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more