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