pub struct OptionalSegment(/* private fields */);Implementations§
Source§impl OptionalSegment
impl OptionalSegment
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ApiPrimitiveError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ApiPrimitiveError>
Creates validated text metadata.
§Errors
Returns ApiPrimitiveError when the value is empty or contains control characters.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the value and returns the stored text.
Trait Implementations§
Source§impl AsRef<str> for OptionalSegment
impl AsRef<str> for OptionalSegment
Source§impl Clone for OptionalSegment
impl Clone for OptionalSegment
Source§fn clone(&self) -> OptionalSegment
fn clone(&self) -> OptionalSegment
Returns a duplicate 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 OptionalSegment
impl Debug for OptionalSegment
Source§impl Display for OptionalSegment
impl Display for OptionalSegment
Source§impl FromStr for OptionalSegment
impl FromStr for OptionalSegment
Source§impl Hash for OptionalSegment
impl Hash for OptionalSegment
Source§impl Ord for OptionalSegment
impl Ord for OptionalSegment
Source§fn cmp(&self, other: &OptionalSegment) -> Ordering
fn cmp(&self, other: &OptionalSegment) -> Ordering
1.21.0 · 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 PartialEq for OptionalSegment
impl PartialEq for OptionalSegment
Source§impl PartialOrd for OptionalSegment
impl PartialOrd for OptionalSegment
Source§impl TryFrom<&str> for OptionalSegment
impl TryFrom<&str> for OptionalSegment
impl Eq for OptionalSegment
impl StructuralPartialEq for OptionalSegment
Auto Trait Implementations§
impl Freeze for OptionalSegment
impl RefUnwindSafe for OptionalSegment
impl Send for OptionalSegment
impl Sync for OptionalSegment
impl Unpin for OptionalSegment
impl UnsafeUnpin for OptionalSegment
impl UnwindSafe for OptionalSegment
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