Skip to main content

UserInfo

Struct UserInfo 

Source
pub struct UserInfo(/* private fields */);
Expand description

URL userinfo: user [":" password], percent-encoded.

Implementations§

Source§

impl UserInfo

Source

pub const fn as_str(&self) -> &str

Returns the component as a string slice.

Source§

impl UserInfo

Source

pub fn new(src: &str) -> Result<&UserInfo, InvalidUrl>

Strictly validates a userinfo.

Source

pub fn username(&self) -> &str

Returns the percent-encoded user name.

Source

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

Returns the percent-encoded password, if present.

Source

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

Returns the decoded user name.

Source

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

Returns the decoded password, if present.

Trait Implementations§

Source§

impl AsRef<str> for UserInfo

Source§

fn as_ref(&self) -> &str

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

impl Debug for UserInfo

Source§

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

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

impl Display for UserInfo

Source§

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

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

impl Eq for UserInfo

Source§

impl Hash for UserInfo

Source§

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

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

impl Ord for UserInfo

Source§

fn cmp(&self, other: &UserInfo) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl PartialEq for UserInfo

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<&str> for UserInfo

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<UserInfo> for str

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<UserInfo> for &str

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialEq<str> for UserInfo

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for UserInfo

Source§

fn partial_cmp(&self, other: &UserInfo) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<'a> TryFrom<&'a str> for &'a UserInfo

Source§

type Error = InvalidUrl

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

fn try_from(s: &'a str) -> Result<Self, Self::Error>

Performs the conversion.

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