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> PartialOrd for Id<'id>
impl<'id> PartialOrd for Id<'id>
impl<'id> Copy for Id<'id>
impl<'id> Eq for Id<'id>
impl<'id> StructuralPartialEq for Id<'id>
Auto Trait Implementations§
impl<'id> Freeze for Id<'id>
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