pub type Name = BoundedName<cm_types::::Name::{constant#0}>;
Expand description
A name that can refer to a component, collection, or other entity in the
Component Manifest. Its length is bounded to MAX_NAME_LENGTH
.
Aliased Type§
struct Name(/* 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<BoundedName<N>, ParseError>
pub fn new( name: impl AsRef<str> + Into<String>, ) -> Result<BoundedName<N>, 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
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}>
Trait Implementations
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<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 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<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 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 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