Skip to main content

URIStr

Struct URIStr 

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

A subtype of str that has been validated as a URI.

Implementations§

Source§

impl URIStr

Source

pub fn resolve(&self, reference: &Self) -> URIString

Resolve the relative reference reference using self as the base URI.

self must be convertible to an absolute URI through fragment removal and normalization.

§Reference
Source

pub fn as_escaped_str(&self) -> &str

Return the escaped URI string.

Source

pub fn as_unescaped_str(&self) -> Option<Cow<'_, str>>

Return the unescaped URI string.

If unescaping fails, return None.

Source

pub fn is_absolute(&self) -> bool

Check if this URI reference is the absolute URI.

§Reference

4.3. Absolute URI

Source

pub fn is_relative(&self) -> bool

Check if this URI reference is the relative reference.

§Reference

4.2. Relative Reference

Source

pub fn scheme(&self) -> Option<&str>

“scheme” part.

§Reference

3.1. Scheme

Source

pub fn authority(&self) -> Option<&str>

“authority” part.

§Reference

3.2. Authority

Source

pub fn userinfo(&self) -> Option<&str>

“userinfo” part.

§Reference

3.2.1. User Information

Source

pub fn host(&self) -> Option<&str>

“host” part.

§Reference

3.2.2. Host

Source

pub fn port(&self) -> Option<&str>

“port” part.

§Reference

3.2.3. Port

Source

pub fn path(&self) -> &str

“path” part.

§Reference

3.3. Path

Source

pub fn query(&self) -> Option<&str>

“query” part.

§Reference

3.4. Query

Source

pub fn fragment(&self) -> Option<&str>

“fragment” part.

§Reference

3.5. Fragment

Source

pub fn components(&self) -> Components<'_>

Return an iterator that scans the URI components.

Trait Implementations§

Source§

impl AsRef<URIStr> for URIStr

Source§

fn as_ref(&self) -> &URIStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<URIStr> for URIString

Source§

fn as_ref(&self) -> &URIStr

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<URIStr> for URIString

Source§

fn borrow(&self) -> &URIStr

Immutably borrows from an owned value. Read more
Source§

impl Clone for Box<URIStr>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for URIStr

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for URIStr

Source§

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

Formats the value using the given formatter. Read more
Source§

impl From<&URIStr> for Arc<URIStr>

Source§

fn from(value: &URIStr) -> Self

Converts to this type from the input type.
Source§

impl From<&URIStr> for Box<URIStr>

Source§

fn from(value: &URIStr) -> Self

Converts to this type from the input type.
Source§

impl From<&URIStr> for Rc<URIStr>

Source§

fn from(value: &URIStr) -> Self

Converts to this type from the input type.
Source§

impl From<&URIStr> for URIString

Source§

fn from(value: &URIStr) -> Self

Converts to this type from the input type.
Source§

impl From<URIString> for Box<URIStr>

Source§

fn from(value: URIString) -> Box<URIStr>

Converts to this type from the input type.
Source§

impl Hash for URIStr

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
Source§

impl PartialEq for URIStr

Source§

fn eq(&self, other: &URIStr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl ToOwned for URIStr

Source§

type Owned = URIString

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> Self::Owned

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

fn clone_into(&self, target: &mut Self::Owned)

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

impl Eq for URIStr

Source§

impl StructuralPartialEq for URIStr

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more