Struct compact_rc::arc::ArcX
source · pub struct ArcX<T: ?Sized, C>(_)
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>where
C: RefCount + Sync + Send,
impl<T, C> ArcX<T, C>where C: RefCount + Sync + Send,
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 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)
Trait Implementations§
source§impl<'a, B, C> From<Cow<'a, B>> for ArcX<B, C>where
C: RefCount + Sync + Send,
B: ToOwned + ?Sized,
ArcX<B, C>: From<&'a B> + From<B::Owned>,
impl<'a, B, C> From<Cow<'a, B>> for ArcX<B, C>where C: RefCount + Sync + Send, B: ToOwned + ?Sized, ArcX<B, C>: From<&'a B> + From<B::Owned>,
source§impl<T, C> FromIterator<T> for ArcX<[T], C>where
C: RefCount + Sync + Send,
impl<T, C> FromIterator<T> for ArcX<[T], C>where C: RefCount + Sync + Send,
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>where
C: RefCount + Sync + Send,
impl<T: ?Sized + Ord, C> Ord for ArcX<T, C>where C: RefCount + Sync + Send,
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 + PartialEq, C> PartialEq<ArcX<T, C>> for ArcX<T, C>where
C: RefCount + Sync + Send,
impl<T: ?Sized + PartialEq, C> PartialEq<ArcX<T, C>> for ArcX<T, C>where C: RefCount + Sync + Send,
source§impl<T: ?Sized + PartialOrd, C> PartialOrd<ArcX<T, C>> for ArcX<T, C>where
C: RefCount + Sync + Send,
impl<T: ?Sized + PartialOrd, C> PartialOrd<ArcX<T, C>> for ArcX<T, C>where C: RefCount + Sync + Send,
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moresource§impl<T, C, const N: usize> TryFrom<ArcX<[T], C>> for ArcX<[T; N], C>where
C: RefCount + Sync + Send,
impl<T, C, const N: usize> TryFrom<ArcX<[T], C>> for ArcX<[T; N], C>where C: RefCount + Sync + Send,
impl<T: ?Sized + Eq, C> Eq for ArcX<T, C>where C: RefCount + Sync + Send,
Auto Trait Implementations§
impl<T: ?Sized, C> RefUnwindSafe for ArcX<T, C>where T: RefUnwindSafe,
impl<T: ?Sized, C> Send for ArcX<T, C>where T: Send + Sync,
impl<T: ?Sized, C> Sync for ArcX<T, C>where T: Send + Sync,
impl<T: ?Sized, C> Unpin for ArcX<T, C>
impl<T: ?Sized, C> UnwindSafe for ArcX<T, C>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