pub struct Segment(/* private fields */);Expand description
One address label — a validated, non-empty, separator-free token.
Constructed only through Segment::parse; see the module docs
for the charset rule and why it is narrow.
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn parse(s: &str) -> Result<Self, SegmentError>
pub fn parse(s: &str) -> Result<Self, SegmentError>
The single fallible constructor. Rules are checked in the order
documented on SegmentError’s arms, so the error names the
most specific failure (ContainsSeparator beats a generic
“illegal character”).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Segment
impl<'de> Deserialize<'de> for Segment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Segment
Source§impl Ord for Segment
impl Ord for Segment
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Segment
impl PartialOrd for Segment
impl StructuralPartialEq for Segment
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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