Struct mnemos_alloc::containers::Arc
source · pub struct Arc<T: ?Sized> {
inner: Arc<T>,
}
Expand description
A wrapper of alloc::sync::Arc<T>
Fields§
§inner: Arc<T>
Implementations§
source§impl<T> Arc<T>
impl<T> Arc<T>
sourcepub fn try_new(t: T) -> Result<Self, T>
pub fn try_new(t: T) -> Result<Self, T>
Attempt to allocate a new reference counted T.
Returns an error containing the provided value if the allocation could not immediately succeed.
NOTE/TODO: Today this will panic if not immediately successful. This should be fixed in the future
sourcepub async fn new(t: T) -> Self
pub async fn new(t: T) -> Self
Attempt to allocate a new reference counted T.
Will not complete until the allocation succeeds
NOTE/TODO: Today this will panic if not immediately successful. This should be fixed in the future
sourcepub fn into_raw(a: Self) -> NonNull<T>
pub fn into_raw(a: Self) -> NonNull<T>
Convert into a pointer
This does NOT change the strong reference count
sourcepub unsafe fn from_raw(nn: NonNull<T>) -> Self
pub unsafe fn from_raw(nn: NonNull<T>) -> Self
Restore from a pointer
This does NOT change the strong reference count.
§Safety
This has the same safety invariants as alloc::sync::Arc.
sourcepub unsafe fn increment_strong_count(ptr: *const T)
pub unsafe fn increment_strong_count(ptr: *const T)
Increment the strong reference count
§Safety
This has the same afety invariants as alloc::sync::Arc::increment_strong_count().
Trait Implementations§
impl<T: Send + Sync> Send for Arc<T>
impl<T: Send + Sync> Sync for Arc<T>
Auto Trait Implementations§
impl<T> Freeze for Arc<T>where
T: ?Sized,
impl<T> RefUnwindSafe for Arc<T>where
T: RefUnwindSafe + ?Sized,
impl<T> Unpin for Arc<T>where
T: ?Sized,
impl<T> UnwindSafe for Arc<T>where
T: RefUnwindSafe + ?Sized,
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)