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§

Trait Implementations§

source§

impl<T: ?Sized, C> AsRef<T> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn as_ref(&self) -> &T

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T: ?Sized, C> Borrow<T> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T: ?Sized, C> Clone for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn clone(&self) -> ArcX<T, C>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: ?Sized + Debug, C> Debug for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Default, C> Default for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn default() -> ArcX<T, C>

Returns the “default value” for a type. Read more
source§

impl<T: ?Sized, C> Deref for ArcX<T, C>where C: RefCount + Sync + Send,

§

type Target = T

The resulting type after dereferencing.
source§

fn deref(&self) -> &T

Dereferences the value.
source§

impl<T: ?Sized + Display, C> Display for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Clone, C> From<&[T]> for ArcX<[T], C>where C: RefCount + Sync + Send,

source§

fn from(v: &[T]) -> ArcX<[T], C>

Converts to this type from the input type.
source§

impl<C> From<&CStr> for ArcX<CStr, C>where C: RefCount + Sync + Send,

source§

fn from(s: &CStr) -> ArcX<CStr, C>

Converts to this type from the input type.
source§

impl<C> From<&str> for ArcX<str, C>where C: RefCount + Sync + Send,

source§

fn from(s: &str) -> ArcX<str, C>

Converts to this type from the input type.
source§

impl<C> From<ArcX<str, C>> for ArcX<[u8], C>where C: RefCount + Sync + Send,

source§

fn from(rc: ArcX<str, C>) -> Self

Converts to this type from the input type.
source§

impl<T, C> From<Box<T, Global>> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn from(b: Box<T>) -> ArcX<T, C>

Converts to this type from the input type.
source§

impl<C> From<CString> for ArcX<CStr, C>where C: RefCount + Sync + Send,

source§

fn from(s: CString) -> ArcX<CStr, C>

Converts to this type from the input type.
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>,

source§

fn from(cow: Cow<'a, B>) -> ArcX<B, C>

Converts to this type from the input type.
source§

impl<C> From<String> for ArcX<str, C>where C: RefCount + Sync + Send,

source§

fn from(s: String) -> ArcX<str, C>

Converts to this type from the input type.
source§

impl<T, C> From<T> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn from(t: T) -> Self

Converts to this type from the input type.
source§

impl<T, C> From<Vec<T, Global>> for ArcX<[T], C>where C: RefCount + Sync + Send,

source§

fn from(v: Vec<T>) -> ArcX<[T], C>

Converts to this type from the input type.
source§

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

Creates a value from an iterator. Read more
source§

impl<T: ?Sized + Hash, C> Hash for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: ?Sized + Ord, C> Ord for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn cmp(&self, other: &ArcX<T, C>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<T: ?Sized + PartialEq, C> PartialEq<ArcX<T, C>> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn eq(&self, other: &ArcX<T, C>) -> bool

This method tests for self and other values to be equal, and is used by ==.
source§

fn ne(&self, other: &ArcX<T, C>) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: ?Sized + PartialOrd, C> PartialOrd<ArcX<T, C>> for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn partial_cmp(&self, other: &ArcX<T, C>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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 more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<T: ?Sized, C> Pointer for ArcX<T, C>where C: RefCount + Sync + Send,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl<T, C, const N: usize> TryFrom<ArcX<[T], C>> for ArcX<[T; N], C>where C: RefCount + Sync + Send,

§

type Error = ArcX<[T], C>

The type returned in the event of a conversion error.
source§

fn try_from(boxed_slice: ArcX<[T], C>) -> Result<Self, Self::Error>

Performs the conversion.
source§

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.