Struct iref::uri::SegmentBuf
source · pub struct SegmentBuf(/* private fields */);
Expand description
Owned URI path segment.
Implementations§
source§impl SegmentBuf
impl SegmentBuf
sourcepub fn new(input: Vec<u8>) -> Result<Self, InvalidSegment<Vec<u8>>>
pub fn new(input: Vec<u8>) -> Result<Self, InvalidSegment<Vec<u8>>>
Creates a new owned URI path segment 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 path segment from the input
value without validation.
§Safety
The input data must be a valid URI path segment.
pub fn as_segment(&self) -> &Segment
source§impl SegmentBuf
impl SegmentBuf
pub fn into_string(self) -> String
Methods from Deref<Target = Segment>§
pub const EMPTY: &'static Self = _
pub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_str(&self) -> &str
pub const CURRENT: &'static Self = _
pub const PARENT: &'static Self = _
sourcepub fn as_pct_str(&self) -> &PctStr
pub fn as_pct_str(&self) -> &PctStr
Returns the segment as a percent-encoded string slice.
sourcepub fn looks_like_scheme(&self) -> bool
pub fn looks_like_scheme(&self) -> bool
Checks if this segments looks like a scheme part.
Returns true
is of the form prefix:suffix
where prefix
is a valid
scheme, of false
otherwise.
Methods from Deref<Target = PctStr>§
Trait Implementations§
source§impl AsRef<[u8]> for SegmentBuf
impl AsRef<[u8]> for SegmentBuf
source§impl AsRef<Segment> for SegmentBuf
impl AsRef<Segment> for SegmentBuf
source§impl AsRef<str> for SegmentBuf
impl AsRef<str> for SegmentBuf
source§impl Borrow<[u8]> for SegmentBuf
impl Borrow<[u8]> for SegmentBuf
source§impl Borrow<Segment> for SegmentBuf
impl Borrow<Segment> for SegmentBuf
source§impl Borrow<str> for SegmentBuf
impl Borrow<str> for SegmentBuf
source§impl Clone for SegmentBuf
impl Clone for SegmentBuf
source§fn clone(&self) -> SegmentBuf
fn clone(&self) -> SegmentBuf
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SegmentBuf
impl Debug for SegmentBuf
source§impl Default for SegmentBuf
impl Default for SegmentBuf
source§impl Deref for SegmentBuf
impl Deref for SegmentBuf
source§impl Display for SegmentBuf
impl Display for SegmentBuf
source§impl From<SegmentBuf> for String
impl From<SegmentBuf> for String
source§fn from(value: SegmentBuf) -> String
fn from(value: SegmentBuf) -> String
Converts to this type from the input type.
source§impl FromStr for SegmentBuf
impl FromStr for SegmentBuf
source§impl Hash for SegmentBuf
impl Hash for SegmentBuf
source§impl Ord for SegmentBuf
impl Ord for SegmentBuf
source§impl<'a> PartialEq<&'a Segment> for SegmentBuf
impl<'a> PartialEq<&'a Segment> for SegmentBuf
source§impl PartialEq<Segment> for SegmentBuf
impl PartialEq<Segment> for SegmentBuf
source§impl PartialEq for SegmentBuf
impl PartialEq for SegmentBuf
source§impl<'a> PartialOrd<&'a Segment> for SegmentBuf
impl<'a> PartialOrd<&'a Segment> for SegmentBuf
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<Segment> for SegmentBuf
impl PartialOrd<Segment> for SegmentBuf
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 SegmentBuf
impl PartialOrd for SegmentBuf
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 TryFrom<String> for SegmentBuf
impl TryFrom<String> for SegmentBuf
§type Error = InvalidSegment<String>
type Error = InvalidSegment<String>
The type returned in the event of a conversion error.
source§fn try_from(input: String) -> Result<SegmentBuf, InvalidSegment<String>>
fn try_from(input: String) -> Result<SegmentBuf, InvalidSegment<String>>
Performs the conversion.
source§impl TryFrom<Vec<u8>> for SegmentBuf
impl TryFrom<Vec<u8>> for SegmentBuf
§type Error = InvalidSegment<Vec<u8>>
type Error = InvalidSegment<Vec<u8>>
The type returned in the event of a conversion error.
source§fn try_from(input: Vec<u8>) -> Result<SegmentBuf, InvalidSegment<Vec<u8>>>
fn try_from(input: Vec<u8>) -> Result<SegmentBuf, InvalidSegment<Vec<u8>>>
Performs the conversion.
impl Eq for SegmentBuf
Auto Trait Implementations§
impl RefUnwindSafe for SegmentBuf
impl Send for SegmentBuf
impl Sync for SegmentBuf
impl Unpin for SegmentBuf
impl UnwindSafe for SegmentBuf
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