pub struct HostBuf(/* private fields */);Expand description
Owned URI host.
Implementations§
source§impl HostBuf
impl HostBuf
sourcepub fn new(input: Vec<u8>) -> Result<Self, InvalidHost<Vec<u8>>>
pub fn new(input: Vec<u8>) -> Result<Self, InvalidHost<Vec<u8>>>
Creates a new owned URI host by parsing the input value
sourcepub const unsafe fn new_unchecked(input: Vec<u8>) -> Self
pub const unsafe fn new_unchecked(input: Vec<u8>) -> Self
Creates a new owned URI host from the input value without validation.
§Safety
The input data must be a valid URI host.
pub fn as_host(&self) -> &Host
Methods from Deref<Target = Host>§
pub const EMPTY: &'static Self = _
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_str(&self) -> &str
sourcepub fn as_pct_str(&self) -> &PctStr
pub fn as_pct_str(&self) -> &PctStr
Returns the host as a percent-encoded string slice.
Methods from Deref<Target = PctStr>§
Trait Implementations§
source§impl Ord for HostBuf
impl Ord for HostBuf
source§impl<'a> PartialEq<&'a Host> for HostBuf
impl<'a> PartialEq<&'a Host> for HostBuf
source§impl PartialEq<Host> for HostBuf
impl PartialEq<Host> for HostBuf
source§impl PartialEq for HostBuf
impl PartialEq for HostBuf
source§impl<'a> PartialOrd<&'a Host> for HostBuf
impl<'a> PartialOrd<&'a Host> for HostBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd<Host> for HostBuf
impl PartialOrd<Host> for HostBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl PartialOrd for HostBuf
impl PartialOrd for HostBuf
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for HostBuf
Auto Trait Implementations§
impl Freeze for HostBuf
impl RefUnwindSafe for HostBuf
impl Send for HostBuf
impl Sync for HostBuf
impl Unpin for HostBuf
impl UnwindSafe for HostBuf
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)