pub struct ProfileName(/* private fields */);Expand description
An exact, validated display name for a saved profile.
Names contain 1 through 128 UTF-8 bytes, contain at least one non-whitespace character, and contain no control characters. Construction does not trim, normalize, or case-fold the supplied string.
Implementations§
Source§impl ProfileName
impl ProfileName
Sourcepub fn new(value: String) -> Result<ProfileName, String>
pub fn new(value: String) -> Result<ProfileName, String>
Validates and retains an exact owned profile name.
Errors are stable and are, in validation order:
profile name must be 1 to 128 bytesprofile name must not contain control charactersprofile name must contain a non-whitespace character
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the name and returns its exact owned string.
Trait Implementations§
Source§impl Clone for ProfileName
impl Clone for ProfileName
Source§fn clone(&self) -> ProfileName
fn clone(&self) -> ProfileName
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ProfileName
impl Debug for ProfileName
impl Eq for ProfileName
Source§impl Hash for ProfileName
impl Hash for ProfileName
Source§impl Ord for ProfileName
impl Ord for ProfileName
Source§fn cmp(&self, other: &ProfileName) -> Ordering
fn cmp(&self, other: &ProfileName) -> Ordering
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for ProfileName
impl PartialEq for ProfileName
Source§impl PartialOrd for ProfileName
impl PartialOrd for ProfileName
impl StructuralPartialEq for ProfileName
Auto Trait Implementations§
impl Freeze for ProfileName
impl RefUnwindSafe for ProfileName
impl Send for ProfileName
impl Sync for ProfileName
impl Unpin for ProfileName
impl UnsafeUnpin for ProfileName
impl UnwindSafe for ProfileName
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