pub struct ComponentInstanceId(/* private fields */);Expand description
Runtime identity for a component instance within a host.
Assigned by the host at instantiation time. Monotonically increasing within a single host process lifetime. Not stable across restarts.
§Invariants
- Unique within a single host process.
- Never reused during the lifetime of a host process.
§Examples
use torvyn_types::ComponentInstanceId;
let id = ComponentInstanceId::new(42);
assert_eq!(id.as_u64(), 42);
assert_eq!(format!("{}", id), "component-42");Implementations§
Trait Implementations§
Source§impl Clone for ComponentInstanceId
impl Clone for ComponentInstanceId
Source§fn clone(&self) -> ComponentInstanceId
fn clone(&self) -> ComponentInstanceId
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 Debug for ComponentInstanceId
impl Debug for ComponentInstanceId
Source§impl<'de> Deserialize<'de> for ComponentInstanceId
impl<'de> Deserialize<'de> for ComponentInstanceId
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Display for ComponentInstanceId
impl Display for ComponentInstanceId
Source§impl From<u64> for ComponentInstanceId
impl From<u64> for ComponentInstanceId
Source§impl Hash for ComponentInstanceId
impl Hash for ComponentInstanceId
Source§impl Ord for ComponentInstanceId
impl Ord for ComponentInstanceId
Source§fn cmp(&self, other: &ComponentInstanceId) -> Ordering
fn cmp(&self, other: &ComponentInstanceId) -> 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 PartialEq for ComponentInstanceId
impl PartialEq for ComponentInstanceId
Source§impl PartialOrd for ComponentInstanceId
impl PartialOrd for ComponentInstanceId
Source§impl Serialize for ComponentInstanceId
impl Serialize for ComponentInstanceId
impl Copy for ComponentInstanceId
impl Eq for ComponentInstanceId
impl StructuralPartialEq for ComponentInstanceId
Auto Trait Implementations§
impl Freeze for ComponentInstanceId
impl RefUnwindSafe for ComponentInstanceId
impl Send for ComponentInstanceId
impl Sync for ComponentInstanceId
impl Unpin for ComponentInstanceId
impl UnwindSafe for ComponentInstanceId
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