Struct generativity::Id
source · #[repr(transparent)]pub struct Id<'id> { /* private fields */ }
Expand description
A phantomdata-like type taking a single invariant lifetime.
Used to manipulate and store the unique invariant lifetime obtained from
Guard
. Use guard.into()
to create a new Id
.
Holding Id<'id>
indicates that the lifetime 'id
is a trusted brand.
'id
will not unify with another trusted brand lifetime unless it comes
from the same original brand (i.e. the same invocation of make_guard!
).
Implementations§
source§impl<'id> Id<'id>
impl<'id> Id<'id>
sourcepub unsafe fn new() -> Self
pub unsafe fn new() -> Self
Construct an Id
with an unbounded lifetime.
You should not need to use this function; use make_guard!
instead.
Safety
Id
holds an invariant lifetime that must be derived from a generative
brand. Using this function directly is the “I know what I’m doing”
button; restrict the lifetime to a known brand immediately to avoid
introducing potential unsoundness.
Trait Implementations§
source§impl<'id> Ord for Id<'id>
impl<'id> Ord for Id<'id>
source§impl<'id> PartialEq<Id<'id>> for Id<'id>
impl<'id> PartialEq<Id<'id>> for Id<'id>
source§impl<'id> PartialOrd<Id<'id>> for Id<'id>
impl<'id> PartialOrd<Id<'id>> for Id<'id>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl<'id> Copy for Id<'id>
impl<'id> Eq for Id<'id>
impl<'id> StructuralEq for Id<'id>
impl<'id> StructuralPartialEq for Id<'id>
Auto Trait Implementations§
impl<'id> RefUnwindSafe for Id<'id>
impl<'id> Send for Id<'id>
impl<'id> Sync for Id<'id>
impl<'id> Unpin for Id<'id>
impl<'id> UnwindSafe for Id<'id>
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