pub type LongName = BoundedName<MAX_LONG_NAME_LENGTH>;
Expand description
A Name
with a higher string capacity of MAX_LONG_NAME_LENGTH
.
Aliased Type§
struct LongName(/* private fields */);
Implementations
Source§impl<const N: usize> BoundedName<N>
impl<const N: usize> BoundedName<N>
Sourcepub fn new(name: impl AsRef<str> + Into<String>) -> Result<Self, ParseError>
pub fn new(name: impl AsRef<str> + Into<String>) -> Result<Self, ParseError>
Creates a BoundedName
from a String
, returning an Err
if the string
fails validation. The string must be non-empty, no more than N
characters in length, and consist of one or more of the
following characters: A-Z
, a-z
, 0-9
, _
, .
, -
. It may not start
with .
or -
.
pub fn as_str(&self) -> &str
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Trait Implementations§
Source§impl From<BoundedName<MAX_NAME_LENGTH>> for LongName
impl From<BoundedName<MAX_NAME_LENGTH>> for LongName
Source§impl<const N: usize> Clone for BoundedName<N>
impl<const N: usize> Clone for BoundedName<N>
Source§fn clone(&self) -> BoundedName<N>
fn clone(&self) -> BoundedName<N>
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<const N: usize> Debug for BoundedName<N>
impl<const N: usize> Debug for BoundedName<N>
Source§impl<'de, const N: usize> Deserialize<'de> for BoundedName<N>
impl<'de, const N: usize> Deserialize<'de> for BoundedName<N>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const N: usize> Display for BoundedName<N>
impl<const N: usize> Display for BoundedName<N>
Source§impl<const N: usize> FromStr for BoundedName<N>
impl<const N: usize> FromStr for BoundedName<N>
Source§impl<const N: usize> Hash for BoundedName<N>
impl<const N: usize> Hash for BoundedName<N>
Source§impl<const N: usize> Ord for BoundedName<N>
impl<const N: usize> Ord for BoundedName<N>
Source§fn cmp(&self, other: &BoundedName<N>) -> Ordering
fn cmp(&self, other: &BoundedName<N>) -> 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