Type Alias LongName

Source
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 BoundedName<MAX_NAME_LENGTH>

Source

pub fn to_long(self) -> LongName

Source§

impl<const N: usize> BoundedName<N>

Source

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 -.

Source

pub fn as_str(&self) -> &str

Source

pub fn is_empty(&self) -> bool

Source

pub fn len(&self) -> usize

Trait Implementations§

Source§

impl From<BoundedName<MAX_NAME_LENGTH>> for LongName

Source§

fn from(name: Name) -> Self

Converts to this type from the input type.
Source§

impl<const N: usize> AsRef<str> for BoundedName<N>

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const N: usize> Borrow<FlyStr> for BoundedName<N>

Source§

fn borrow(&self) -> &FlyStr

Immutably borrows from an owned value. Read more
Source§

impl<const N: usize> Clone for BoundedName<N>

Source§

fn clone(&self) -> BoundedName<N>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<const N: usize> Debug for BoundedName<N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de, const N: usize> Deserialize<'de> for BoundedName<N>

Source§

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>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<const N: usize> FromStr for BoundedName<N>

Source§

type Err = ParseError

The associated error which can be returned from parsing.
Source§

fn from_str(name: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl<const N: usize> Hash for BoundedName<N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<const N: usize> Ord for BoundedName<N>

Source§

fn cmp(&self, other: &BoundedName<N>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<const N: usize> PartialEq<&str> for BoundedName<N>

Source§

fn eq(&self, o: &&str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialEq<String> for BoundedName<N>

Source§

fn eq(&self, o: &String) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialEq for BoundedName<N>

Source§

fn eq(&self, other: &BoundedName<N>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<const N: usize> PartialOrd for BoundedName<N>

Source§

fn partial_cmp(&self, other: &BoundedName<N>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<const N: usize> Serialize for BoundedName<N>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<const N: usize> Eq for BoundedName<N>

Source§

impl<const N: usize> StructuralPartialEq for BoundedName<N>