pub struct BoundedName<const N: usize>(/* private fields */);Expand description
A BoundedName is a Name that can have a max length of N bytes.
Implementations§
Source§impl BoundedName<cm_types::::Name::{constant#0}>
impl BoundedName<cm_types::::Name::{constant#0}>
pub fn to_long(self) -> BoundedName<cm_types::::LongName::{constant#0}>
Source§impl<const N: usize> BoundedName<N>
impl<const N: usize> BoundedName<N>
Sourcepub fn new(s: impl AsRef<str>) -> Result<BoundedName<N>, ParseError>
pub fn new(s: impl AsRef<str>) -> Result<BoundedName<N>, ParseError>
Creates a BoundedName from a &str slice, 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
Methods from Deref<Target = BoundedBorrowedName<N>>§
Trait Implementations§
Source§impl<const N: usize> AsRef<BoundedBorrowedName<N>> for BoundedName<N>
impl<const N: usize> AsRef<BoundedBorrowedName<N>> for BoundedName<N>
Source§fn as_ref(&self) -> &BoundedBorrowedName<N>
fn as_ref(&self) -> &BoundedBorrowedName<N>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<const N: usize> AsRef<BoundedName<N>> for BoundedName<N>
impl<const N: usize> AsRef<BoundedName<N>> for BoundedName<N>
Source§fn as_ref(&self) -> &BoundedName<N>
fn as_ref(&self) -> &BoundedName<N>
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<const N: usize> Borrow<BoundedBorrowedName<N>> for BoundedName<N>
impl<const N: usize> Borrow<BoundedBorrowedName<N>> for BoundedName<N>
Source§fn borrow(&self) -> &BoundedBorrowedName<N>
fn borrow(&self) -> &BoundedBorrowedName<N>
Immutably borrows from an owned value. Read more
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 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<const N: usize> Debug for BoundedName<N>
impl<const N: usize> Debug for BoundedName<N>
Source§impl<const N: usize> Deref for BoundedName<N>
impl<const N: usize> Deref for BoundedName<N>
Source§type Target = BoundedBorrowedName<N>
type Target = BoundedBorrowedName<N>
The resulting type after dereferencing.
Source§fn deref(&self) -> &BoundedBorrowedName<N>
fn deref(&self) -> &BoundedBorrowedName<N>
Dereferences the value.
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<BoundedName<N>, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<BoundedName<N>, <D as Deserializer<'de>>::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> From<&BoundedBorrowedName<N>> for BoundedName<N>
impl<const N: usize> From<&BoundedBorrowedName<N>> for BoundedName<N>
Source§fn from(o: &BoundedBorrowedName<N>) -> BoundedName<N>
fn from(o: &BoundedBorrowedName<N>) -> BoundedName<N>
Converts to this type from the input type.
Source§impl From<BoundedName<cm_types::::Name::{constant#0}>> for BoundedName<cm_types::::LongName::{constant#0}>
impl From<BoundedName<cm_types::::Name::{constant#0}>> for BoundedName<cm_types::::LongName::{constant#0}>
Source§fn from(
name: BoundedName<cm_types::::Name::{constant#0}>,
) -> BoundedName<cm_types::::LongName::{constant#0}>
fn from( name: BoundedName<cm_types::::Name::{constant#0}>, ) -> BoundedName<cm_types::::LongName::{constant#0}>
Converts to this type from the input type.
Source§impl From<HandleType> for BoundedName<cm_types::::Name::{constant#0}>
impl From<HandleType> for BoundedName<cm_types::::Name::{constant#0}>
Source§fn from(
numbered_handle: HandleType,
) -> BoundedName<cm_types::::Name::{constant#0}>
fn from( numbered_handle: HandleType, ) -> BoundedName<cm_types::::Name::{constant#0}>
Converts to this type from the input type.
Source§impl<const N: usize> FromStr for BoundedName<N>
impl<const N: usize> FromStr for BoundedName<N>
Source§type Err = ParseError
type Err = ParseError
The associated error which can be returned from parsing.
Source§fn from_str(
name: &str,
) -> Result<BoundedName<N>, <BoundedName<N> as FromStr>::Err>
fn from_str( name: &str, ) -> Result<BoundedName<N>, <BoundedName<N> as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§impl<const N: usize> Hash for BoundedName<N>
impl<const N: usize> Hash for BoundedName<N>
Source§impl IterablePath for &BoundedName<cm_types::::Name::{constant#0}>
impl IterablePath for &BoundedName<cm_types::::Name::{constant#0}>
Source§fn iter_segments(&self) -> impl DoubleEndedIterator + Send
fn iter_segments(&self) -> impl DoubleEndedIterator + Send
Returns a double-sided iterator over the segments in this path.
Source§impl IterablePath for BoundedName<cm_types::::Name::{constant#0}>
impl IterablePath for BoundedName<cm_types::::Name::{constant#0}>
Source§fn iter_segments(&self) -> impl DoubleEndedIterator + Send
fn iter_segments(&self) -> impl DoubleEndedIterator + Send
Returns a double-sided iterator over the segments in this path.
Source§impl NativeIntoFidl<String> for BoundedName<cm_types::::LongName::{constant#0}>
impl NativeIntoFidl<String> for BoundedName<cm_types::::LongName::{constant#0}>
fn native_into_fidl(self) -> String
Source§impl NativeIntoFidl<String> for BoundedName<cm_types::::Name::{constant#0}>
impl NativeIntoFidl<String> for BoundedName<cm_types::::Name::{constant#0}>
fn native_into_fidl(self) -> String
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
Source§impl<const N: usize> PartialEq<BoundedBorrowedName<N>> for BoundedName<N>
impl<const N: usize> PartialEq<BoundedBorrowedName<N>> for BoundedName<N>
Source§impl<const N: usize> PartialEq<BoundedName<N>> for BoundedBorrowedName<N>
impl<const N: usize> PartialEq<BoundedName<N>> for BoundedBorrowedName<N>
Source§impl<const N: usize> PartialEq for BoundedName<N>
impl<const N: usize> PartialEq for BoundedName<N>
Source§impl<const N: usize> PartialOrd for BoundedName<N>
impl<const N: usize> PartialOrd for BoundedName<N>
Source§impl<const N: usize> Serialize for BoundedName<N>
impl<const N: usize> Serialize for BoundedName<N>
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<const N: usize> Eq for BoundedName<N>
impl<const N: usize> StructuralPartialEq for BoundedName<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for BoundedName<N>
impl<const N: usize> RefUnwindSafe for BoundedName<N>
impl<const N: usize> Send for BoundedName<N>
impl<const N: usize> Sync for BoundedName<N>
impl<const N: usize> Unpin for BoundedName<N>
impl<const N: usize> UnwindSafe for BoundedName<N>
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, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 more