pub struct UnitId(/* private fields */);Expand description
The content address of a crate::Unit.
A newtype, not an alias. As aliases, UnitId and PacketId were the
same type, so a packet id fitted a unit slot silently and the compiler had
nothing to say about it. Provenance that can be assembled out of the wrong
kind of address is not provenance.
Implementations§
Source§impl UnitId
impl UnitId
Sourcepub const fn as_content_id(&self) -> &ContentId
pub const fn as_content_id(&self) -> &ContentId
Borrow the underlying content id of this unit.
Sourcepub const fn into_content_id(self) -> ContentId
pub const fn into_content_id(self) -> ContentId
Consume this unit id, yielding the content id.
Trait Implementations§
impl Copy for UnitId
Source§impl<'de> Deserialize<'de> for UnitId
impl<'de> Deserialize<'de> for UnitId
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
impl Eq for UnitId
Source§impl Ord for UnitId
impl Ord for UnitId
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for UnitId
impl PartialOrd for UnitId
impl StructuralPartialEq for UnitId
Auto Trait Implementations§
impl Freeze for UnitId
impl RefUnwindSafe for UnitId
impl Send for UnitId
impl Sync for UnitId
impl Unpin for UnitId
impl UnsafeUnpin for UnitId
impl UnwindSafe for UnitId
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