pub struct Description(/* private fields */);Implementations§
Source§impl Description
impl Description
pub const MIN_CHAR_LENGTH: usize = 3usize
pub const MAX_CHAR_LENGTH: usize = 10_000usize
Sourcepub fn new<T: AsRef<str> + Into<String>>(
description: T,
) -> Result<Self, DescriptionError>
pub fn new<T: AsRef<str> + Into<String>>( description: T, ) -> Result<Self, DescriptionError>
Creates a new Description from any type that implements AsRef<str> and
Into<CompactString>.
§Errors
Returns an Err if the description is less than 3 characters long or more than 10,000
characters long.
Sourcepub unsafe fn new_unchecked<T: Into<String>>(description: T) -> Self
pub unsafe fn new_unchecked<T: Into<String>>(description: T) -> Self
Creates a new Description from any type that implements Into<String> without checking
its validity.
§Safety
The description must not be less than 3 characters long or more than 10,000 characters long.
Trait Implementations§
Source§impl AsRef<str> for Description
impl AsRef<str> for Description
Source§impl Clone for Description
impl Clone for Description
Source§fn clone(&self) -> Description
fn clone(&self) -> Description
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 Description
impl Debug for Description
Source§impl Display for Description
impl Display for Description
Source§impl FromStr for Description
impl FromStr for Description
Source§impl Hash for Description
impl Hash for Description
Source§impl Ord for Description
impl Ord for Description
Source§fn cmp(&self, other: &Description) -> Ordering
fn cmp(&self, other: &Description) -> 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 Description
impl PartialEq for Description
Source§impl PartialOrd for Description
impl PartialOrd for Description
Source§impl TryFrom<String> for Description
impl TryFrom<String> for Description
impl Eq for Description
impl StructuralPartialEq for Description
Auto Trait Implementations§
impl Freeze for Description
impl RefUnwindSafe for Description
impl Send for Description
impl Sync for Description
impl Unpin for Description
impl UnwindSafe for Description
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