pub struct ArcLite<T> { /* private fields */ }
Expand description
A lightweight atomic reference counter similar to Arc but with manual control.
This provides thread-safe reference counting without requiring std::sync::Arc. Unlike standard Arc, this allows manual increment/decrement operations which can be useful for intrusive data structures.
Implementations§
Source§impl<T> ArcLite<T>
impl<T> ArcLite<T>
Sourcepub fn try_inc(&self) -> bool
pub fn try_inc(&self) -> bool
Increment the reference count.
This is useful for intrusive data structures where you need manual control over the reference count.
§Returns
true
if the increment succeeded, false
if the object was being destroyed.
Trait Implementations§
impl<T: Send + Sync> Send for ArcLite<T>
impl<T: Send + Sync> Sync for ArcLite<T>
Auto Trait Implementations§
impl<T> Freeze for ArcLite<T>
impl<T> RefUnwindSafe for ArcLite<T>where
T: RefUnwindSafe,
impl<T> Unpin for ArcLite<T>
impl<T> UnwindSafe for ArcLite<T>where
T: RefUnwindSafe,
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