pub struct Segment(/* private fields */);Expand description
IRI path segment.
Implementations§
source§impl Segment
impl Segment
sourcepub fn new<T: ?Sized + AsRef<str>>(
input: &T,
) -> Result<&Self, InvalidSegment<&T>>
pub fn new<T: ?Sized + AsRef<str>>( input: &T, ) -> Result<&Self, InvalidSegment<&T>>
Creates a new IRI path segment by parsing the input value
sourcepub const unsafe fn new_unchecked(input: &str) -> &Self
pub const unsafe fn new_unchecked(input: &str) -> &Self
Creates a new IRI path segment from the input value without validation.
§Safety
The input data must be a valid IRI 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 PartialEq for Segment
impl PartialEq for Segment
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 Segment
impl PartialOrd for Segment
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 ToOwned for Segment
impl ToOwned for Segment
§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