pub struct DebugChecked { /* private fields */ }Expand description
Equivalent to id::Checked when debug_assertions are enabled, but equivalent to
id::Unchecked in release.
This type is only available on platforms with 64-bit atomics.
Implementations§
Source§impl DebugChecked
impl DebugChecked
Sourcepub unsafe fn new() -> Unique<Self>
pub unsafe fn new() -> Unique<Self>
Create a new DebugChecked. With debug_assertions enabled, this will increment a
global atomic counter. In release, this is a no-op.
§Safety
The returned ID must not be compared against any other DebugChecked IDs that
originated from a different call to this function.
Note that this function is completely safe to use when debug_assertions are enabled,
although it still requires unsafe due to the behaviour in release.
Trait Implementations§
Source§impl Clone for DebugChecked
impl Clone for DebugChecked
Source§fn clone(&self) -> DebugChecked
fn clone(&self) -> DebugChecked
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DebugChecked
Source§impl Debug for DebugChecked
impl Debug for DebugChecked
impl Eq for DebugChecked
impl Id for DebugChecked
Source§impl PartialEq for DebugChecked
impl PartialEq for DebugChecked
Source§fn eq(&self, other: &DebugChecked) -> bool
fn eq(&self, other: &DebugChecked) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DebugChecked
Auto Trait Implementations§
impl Freeze for DebugChecked
impl RefUnwindSafe for DebugChecked
impl Send for DebugChecked
impl Sync for DebugChecked
impl Unpin for DebugChecked
impl UnsafeUnpin for DebugChecked
impl UnwindSafe for DebugChecked
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