pub struct HardwareClassId(/* private fields */);Expand description
Validated namespaced identity of a hardware class.
§Examples
use tenferro_runtime::HardwareClassId;
assert_eq!(HardwareClassId::new("tenferro.cpu.host")?.as_str(), "tenferro.cpu.host");Implementations§
Source§impl HardwareClassId
impl HardwareClassId
Sourcepub fn new(value: impl Into<Arc<str>>) -> Result<Self, IdentityError>
pub fn new(value: impl Into<Arc<str>>) -> Result<Self, IdentityError>
Validate a lowercase ASCII namespaced hardware-class identifier.
§Examples
use tenferro_runtime::HardwareClassId;
assert!(HardwareClassId::new("tenferro.cpu").is_ok());§Errors
Returns IdentityError with IdentityKind::HardwareClass when
value does not match the lowercase ASCII namespaced identifier grammar.
Trait Implementations§
Source§impl Clone for HardwareClassId
impl Clone for HardwareClassId
Source§fn clone(&self) -> HardwareClassId
fn clone(&self) -> HardwareClassId
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 HardwareClassId
impl Debug for HardwareClassId
Source§impl Hash for HardwareClassId
impl Hash for HardwareClassId
Source§impl Ord for HardwareClassId
impl Ord for HardwareClassId
Source§fn cmp(&self, other: &HardwareClassId) -> Ordering
fn cmp(&self, other: &HardwareClassId) -> 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 HardwareClassId
impl PartialEq for HardwareClassId
Source§fn eq(&self, other: &HardwareClassId) -> bool
fn eq(&self, other: &HardwareClassId) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for HardwareClassId
impl PartialOrd for HardwareClassId
impl Eq for HardwareClassId
impl StructuralPartialEq for HardwareClassId
Auto Trait Implementations§
impl Freeze for HardwareClassId
impl RefUnwindSafe for HardwareClassId
impl Send for HardwareClassId
impl Sync for HardwareClassId
impl Unpin for HardwareClassId
impl UnsafeUnpin for HardwareClassId
impl UnwindSafe for HardwareClassId
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§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