pub struct ArcToken(/* private fields */);Available on crate feature
alloc and target_has_atomic="ptr" only.Expand description
An Arc-based unforgeable token used to access the contents of a
TokenLock.
This type lacks a Clone implementation to ensure exclusive access to
TokenLock.
Implementations§
Source§impl ArcToken
impl ArcToken
pub fn new() -> Self
Sourcepub fn id(&self) -> ArcTokenId
pub fn id(&self) -> ArcTokenId
Construct an ArcTokenId that equates to self.
Sourcepub fn borrow_as_unsync(&mut self) -> ArcTokenUnsyncRef<'_>
pub fn borrow_as_unsync(&mut self) -> ArcTokenUnsyncRef<'_>
Borrow self as a non-Sync reference.
Non-Sync tokens such as those created by this method can be used with
UnsyncTokenLock.
Trait Implementations§
Source§impl Token<ArcTokenId> for ArcToken
impl Token<ArcTokenId> for ArcToken
fn eq_id(&self, id: &ArcTokenId) -> bool
impl Eq for ArcToken
impl StructuralPartialEq for ArcToken
Auto Trait Implementations§
impl Freeze for ArcToken
impl RefUnwindSafe for ArcToken
impl Send for ArcToken
impl Sync for ArcToken
impl Unpin for ArcToken
impl UnwindSafe for ArcToken
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