pub struct ComponentId(/* private fields */);Expand description
A stable component identifier.
Implementations§
Source§impl ComponentId
impl ComponentId
Sourcepub fn new(value: impl AsRef<str>) -> Result<Self, ComponentTextError>
pub fn new(value: impl AsRef<str>) -> Result<Self, ComponentTextError>
Creates a component ID from non-empty text.
§Errors
Returns ComponentTextError::Empty when the trimmed value is empty.
Sourcepub fn into_string(self) -> String
pub fn into_string(self) -> String
Consumes the ID and returns the owned string.
Trait Implementations§
Source§impl AsRef<str> for ComponentId
impl AsRef<str> for ComponentId
Source§impl Clone for ComponentId
impl Clone for ComponentId
Source§fn clone(&self) -> ComponentId
fn clone(&self) -> ComponentId
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 ComponentId
impl Debug for ComponentId
Source§impl Display for ComponentId
impl Display for ComponentId
Source§impl FromStr for ComponentId
impl FromStr for ComponentId
Source§impl Hash for ComponentId
impl Hash for ComponentId
Source§impl Ord for ComponentId
impl Ord for ComponentId
Source§fn cmp(&self, other: &ComponentId) -> Ordering
fn cmp(&self, other: &ComponentId) -> 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
Source§impl PartialEq for ComponentId
impl PartialEq for ComponentId
Source§fn eq(&self, other: &ComponentId) -> bool
fn eq(&self, other: &ComponentId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for ComponentId
impl PartialOrd for ComponentId
impl Eq for ComponentId
impl StructuralPartialEq for ComponentId
Auto Trait Implementations§
impl Freeze for ComponentId
impl RefUnwindSafe for ComponentId
impl Send for ComponentId
impl Sync for ComponentId
impl Unpin for ComponentId
impl UnsafeUnpin for ComponentId
impl UnwindSafe for ComponentId
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