Struct Authority
struct Authority { ... }
Represents the authority component of a URI.
Implementations
impl Authority
fn from_static(src: &'static str) -> SelfAttempt to convert an
Authorityfrom a static string.This function will not perform any copying, and the string will be checked if it is empty or contains an invalid character.
Panics
This function panics if the argument contains invalid characters or is empty.
Examples
# use Authority; let authority = from_static; assert_eq!;Attempt to convert a
Bytesbuffer to aAuthority.This will try to prevent a copy if the type passed is the type used internally, and will copy the data if it is not.
fn host(self: &Self) -> &strGet the host of this
Authority.The host subcomponent of authority is identified by an IP literal encapsulated within square brackets, an IPv4 address in dotted- decimal form, or a registered name. The host subcomponent is case-insensitive.
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1 |---------| | hostExamples
# use *; let authority: Authority = "example.org:80".parse.unwrap; assert_eq!;fn port(self: &Self) -> Option<Port<&str>>Get the port part of this
Authority.The port subcomponent of authority is designated by an optional port number following the host and delimited from it by a single colon (":") character. It can be turned into a decimal port number with the
as_u16method or as astrwith theas_strmethod.abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1 |-| | portExamples
Authority with port
# use Authority; let authority: Authority = "example.org:80".parse.unwrap; let port = authority.port.unwrap; assert_eq!; assert_eq!;Authority without port
# use Authority; let authority: Authority = "example.org".parse.unwrap; assert!;fn port_u16(self: &Self) -> Option<u16>Get the port of this
Authorityas au16.Example
# use Authority; let authority: Authority = "example.org:80".parse.unwrap; assert_eq!;fn as_str(self: &Self) -> &strReturn a str representation of the authority
impl AsRef for Authority
fn as_ref(self: &Self) -> &str
impl Clone for Authority
fn clone(self: &Self) -> Authority
impl Debug for Authority
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Display for Authority
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Eq for Authority
impl Freeze for Authority
impl FromStr for Authority
fn from_str(s: &str) -> Result<Self, InvalidUri>
impl Hash for Authority
fn hash<H>(self: &Self, state: &mut H) where H: Hasher
impl PartialEq for Authority
fn eq(self: &Self, other: &str) -> bool
impl PartialEq for Authority
fn eq(self: &Self, other: &Authority) -> bool
impl PartialEq for Authority
fn eq(self: &Self, other: &String) -> bool
impl PartialOrd for Authority
fn partial_cmp(self: &Self, other: &Authority) -> Option<Ordering>
impl PartialOrd for Authority
fn partial_cmp(self: &Self, other: &String) -> Option<Ordering>
impl PartialOrd for Authority
fn partial_cmp(self: &Self, other: &str) -> Option<Ordering>
impl RefUnwindSafe for Authority
impl Send for Authority
impl Sync for Authority
impl TryFrom for Authority
fn try_from(vec: Vec<u8>) -> Result<Self, <Self as >::Error>
impl TryFrom for Authority
fn try_from(t: String) -> Result<Self, <Self as >::Error>
impl Unpin for Authority
impl UnsafeUnpin for Authority
impl UnwindSafe for Authority
impl<'a> PartialEq for Authority
fn eq(self: &Self, other: &&'a str) -> bool
impl<'a> PartialOrd for Authority
fn partial_cmp(self: &Self, other: &&'a str) -> Option<Ordering>
impl<'a> TryFrom for Authority
fn try_from(s: &'a [u8]) -> Result<Self, <Self as >::Error>
impl<'a> TryFrom for Authority
fn try_from(s: &'a str) -> Result<Self, <Self as >::Error>
impl<T> Any for Authority
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for Authority
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for Authority
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for Authority
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for Authority
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Authority
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T> ToString for Authority
fn to_string(self: &Self) -> String
impl<T, U> Into for Authority
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for Authority
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for Authority
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>