pub struct ArcX<T: ?Sized, C>(/* private fields */)
where
C: RefCount + Sync + Send;Expand description
Low-memory version of std::sync::Arc.
This type provides almost the same methods as standard Arc.
See the top page for about differences from the standard Arc.
There are aliases for simplicity.
Implementations§
Source§impl<T, C> ArcX<T, C>
impl<T, C> ArcX<T, C>
Sourcepub fn new(value: T) -> ArcX<T, C>
pub fn new(value: T) -> ArcX<T, C>
See std::sync::Arc::new.
Sourcepub fn pin(value: T) -> Pin<ArcX<T, C>>
pub fn pin(value: T) -> Pin<ArcX<T, C>>
See std::sync::Arc::pin.
Sourcepub fn try_unwrap(this: Self) -> Result<T, Self>
pub fn try_unwrap(this: Self) -> Result<T, Self>
Sourcepub unsafe fn from_raw(ptr: *const T) -> Self
pub unsafe fn from_raw(ptr: *const T) -> Self
§Incompatibility
Unlike the standard Arc, this method does not support dynamically sized types (DSTs)
because some unstabilized features are required to implement this for DSTs.
Sourcepub unsafe fn increment_strong_count(ptr: *const T)
pub unsafe fn increment_strong_count(ptr: *const T)
Sourcepub unsafe fn decrement_strong_count(ptr: *const T)
pub unsafe fn decrement_strong_count(ptr: *const T)
Sourcepub fn into_inner(this: Self) -> Option<T>
pub fn into_inner(this: Self) -> Option<T>
Trait Implementations§
Source§impl<T, C> FromIterator<T> for ArcX<[T], C>
impl<T, C> FromIterator<T> for ArcX<[T], C>
Source§fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> Self
Creates a value from an iterator. Read more
Source§impl<T: ?Sized + Ord, C> Ord for ArcX<T, C>
impl<T: ?Sized + Ord, C> Ord for ArcX<T, C>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: ?Sized + PartialOrd, C> PartialOrd for ArcX<T, C>
impl<T: ?Sized + PartialOrd, C> PartialOrd for ArcX<T, C>
impl<T: ?Sized + Eq, C> Eq for ArcX<T, C>
Auto Trait Implementations§
impl<T, C> Freeze for ArcX<T, C>where
T: ?Sized,
impl<T, C> RefUnwindSafe for ArcX<T, C>where
T: RefUnwindSafe + ?Sized,
impl<T, C> Send for ArcX<T, C>
impl<T, C> Sync for ArcX<T, C>
impl<T, C> Unpin for ArcX<T, C>where
T: ?Sized,
impl<T, C> UnwindSafe for ArcX<T, C>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
Mutably borrows from an owned value. Read more