pub struct RequestTarget { /* private fields */ }Expand description
A validated HTTP request target in origin form.
The raw target is preserved for logging or downstream parsing. The validated path and optional query are available through accessor methods.
§Security
This type does not perform percent decoding or path normalization.
Those operations belong to the [ConfinedPath] validation pipeline
and must not be duplicated here.
Implementations§
Source§impl RequestTarget
impl RequestTarget
Sourcepub fn parse(raw: impl Into<String>) -> Result<Self, RequestTargetError>
pub fn parse(raw: impl Into<String>) -> Result<Self, RequestTargetError>
Parse and validate a request target.
§Errors
Returns RequestTargetError if the target is not valid origin-form.
Sourcepub fn path_and_query(&self) -> &str
pub fn path_and_query(&self) -> &str
Returns the full target including query, if present.
Trait Implementations§
Source§impl Clone for RequestTarget
impl Clone for RequestTarget
Source§fn clone(&self) -> RequestTarget
fn clone(&self) -> RequestTarget
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RequestTarget
impl Debug for RequestTarget
Source§impl Display for RequestTarget
impl Display for RequestTarget
impl Eq for RequestTarget
Source§impl PartialEq for RequestTarget
impl PartialEq for RequestTarget
impl StructuralPartialEq for RequestTarget
Auto Trait Implementations§
impl Freeze for RequestTarget
impl RefUnwindSafe for RequestTarget
impl Send for RequestTarget
impl Sync for RequestTarget
impl Unpin for RequestTarget
impl UnsafeUnpin for RequestTarget
impl UnwindSafe for RequestTarget
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