#[non_exhaustive]pub struct DebugTag(/* private fields */);
Expand description
A value that guarentees that if two DebugTag
s are not equal, then they are not clones.
This can be used to tag information during debug, such that the use of a value can be tracked and checked. For example, you can use this to ensure (in debug) that a value returned by a data structure is only used with the instance that returned the value.
This tagging is only done if debug_assertions
is set. If debug_assertions
is not set, then
all DebugTags
are equal. Even if debug_assertions
is set, two DebugTag
s that are not
clones can still be equal. This is unlikely, however.
Therefore, functionality should not directly depend on the equality these tags but only use them for additional sanity checks.
Implementations§
Trait Implementations§
impl Copy for DebugTag
impl Eq for DebugTag
impl StructuralPartialEq for DebugTag
Auto Trait Implementations§
impl Freeze for DebugTag
impl RefUnwindSafe for DebugTag
impl Send for DebugTag
impl Sync for DebugTag
impl Unpin for DebugTag
impl UnwindSafe for DebugTag
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