pub struct DocumentLabel(/* private fields */);Implementations§
Source§impl DocumentLabel
impl DocumentLabel
pub const MAX_CHAR_LENGTH: usize = 100usize
Sourcepub fn new<T: AsRef<str> + Into<CompactString>>(
document_label: T,
) -> Result<Self, DocumentLabelError>
pub fn new<T: AsRef<str> + Into<CompactString>>( document_label: T, ) -> Result<Self, DocumentLabelError>
Creates a new DocumentLabel from any type that implements AsRef<str> and
Into<CompactString>.
§Errors
Returns an Err if the document label is empty or more than 100 characters long.
Sourcepub unsafe fn new_unchecked<T: Into<CompactString>>(document_label: T) -> Self
pub unsafe fn new_unchecked<T: Into<CompactString>>(document_label: T) -> Self
Creates a new DocumentLabel from any type that implements Into<CompactString> without
checking its validity.
§Safety
The document label must not be empty or more than 100 characters long.
Trait Implementations§
Source§impl AsRef<str> for DocumentLabel
impl AsRef<str> for DocumentLabel
Source§impl Clone for DocumentLabel
impl Clone for DocumentLabel
Source§fn clone(&self) -> DocumentLabel
fn clone(&self) -> DocumentLabel
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 DocumentLabel
impl Debug for DocumentLabel
Source§impl Display for DocumentLabel
impl Display for DocumentLabel
Source§impl FromStr for DocumentLabel
impl FromStr for DocumentLabel
Source§impl Hash for DocumentLabel
impl Hash for DocumentLabel
Source§impl Ord for DocumentLabel
impl Ord for DocumentLabel
Source§fn cmp(&self, other: &DocumentLabel) -> Ordering
fn cmp(&self, other: &DocumentLabel) -> 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 DocumentLabel
impl PartialEq for DocumentLabel
Source§impl PartialOrd for DocumentLabel
impl PartialOrd for DocumentLabel
Source§impl TryFrom<&str> for DocumentLabel
impl TryFrom<&str> for DocumentLabel
impl Eq for DocumentLabel
impl StructuralPartialEq for DocumentLabel
Auto Trait Implementations§
impl Freeze for DocumentLabel
impl RefUnwindSafe for DocumentLabel
impl Send for DocumentLabel
impl Sync for DocumentLabel
impl Unpin for DocumentLabel
impl UnwindSafe for DocumentLabel
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more