pub struct Segment(/* private fields */);
Expand description
IRI path segment.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn new<T: ?Sized + AsRef<[u8]>>(
input: &T,
) -> Result<&Self, InvalidSegment<&T>>
pub fn new<T: ?Sized + AsRef<[u8]>>( input: &T, ) -> Result<&Self, InvalidSegment<&T>>
Creates a new URI path segment by parsing the input
value
Sourcepub const unsafe fn new_unchecked(input: &[u8]) -> &Self
pub const unsafe fn new_unchecked(input: &[u8]) -> &Self
Creates a new URI path segment from the input
value without validation.
§Safety
The input data must be a valid URI path segment.
Source§impl Segment
impl Segment
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<Segment> for SegmentBuf
impl AsRef<Segment> for SegmentBuf
Source§impl Borrow<Segment> for SegmentBuf
impl Borrow<Segment> 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<'a> PartialOrd<&'a Segment> for SegmentBuf
impl<'a> PartialOrd<&'a Segment> for SegmentBuf
Source§impl PartialOrd<Segment> for SegmentBuf
impl PartialOrd<Segment> for SegmentBuf
Source§impl PartialOrd for Segment
impl PartialOrd for Segment
Source§impl ToOwned for Segment
impl ToOwned for Segment
Source§type Owned = SegmentBuf
type Owned = SegmentBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> SegmentBuf
fn to_owned(&self) -> SegmentBuf
Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more