Skip to main content

HttpUri

Struct HttpUri 

Source
pub struct HttpUri { /* private fields */ }
Expand description

An HTTP URI or relative location with a precomputed diagnostic representation.

Construction preserves the original spelling and masks user information and recognized credential query values in a separate representation. It does not validate, resolve, or normalize the URI. Ordinary query values remain intact. Clones share both representations; formatting does not repeat redaction.

Recognized query names are Signature, Policy, token, access_token, X-Amz-Signature, and X-Amz-Security-Token, matched case-insensitively after decoding the name. Arbitrary application parameters are not classified.

Implementations§

Source§

impl HttpUri

Source

pub fn new(uri: impl Into<Arc<str>>) -> Self

Retain the original URI and compute its diagnostic representation once.

Source

pub fn original_uri(&self) -> &str

Return the original URI, including any credentials it contains.

Source

pub fn redacted_uri(&self) -> &str

Return the URI with recognized credentials masked for diagnostics.

Source

pub fn from_response_location(parts: &mut Parts) -> Option<&Self>

Get or create the diagnostic value for a response’s Location header.

Store it in response extensions so service errors and shared response diagnostics reuse the same value. If a wrapper changes the header, replace the cached value. Return None for missing or non-text headers. The original header is not changed.

Trait Implementations§

Source§

impl Clone for HttpUri

Source§

fn clone(&self) -> HttpUri

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for HttpUri

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.