Struct compact_rc::rc::RcX
source · pub struct RcX<T: ?Sized, C>(_)
where
Cell<C>: RefCount;Expand description
Low-memory version of std::rc::Rc.
A type provides almost the same methods as standard Rc.
See the top page for about differences from the standard Rc.
There are aliases for simplicity.
Implementations§
source§impl<T, C> RcX<T, C>where
Cell<C>: RefCount,
impl<T, C> RcX<T, C>where Cell<C>: RefCount,
sourcepub fn new(value: T) -> RcX<T, C>
pub fn new(value: T) -> RcX<T, C>
See std::rc::Rc::new.
sourcepub fn pin(value: T) -> Pin<RcX<T, C>>
pub fn pin(value: T) -> Pin<RcX<T, C>>
See std::rc::Rc::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 Rc, 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<'a, B, C> From<Cow<'a, B>> for RcX<B, C>where
Cell<C>: RefCount,
B: ToOwned + ?Sized,
RcX<B, C>: From<&'a B> + From<B::Owned>,
impl<'a, B, C> From<Cow<'a, B>> for RcX<B, C>where Cell<C>: RefCount, B: ToOwned + ?Sized, RcX<B, C>: From<&'a B> + From<B::Owned>,
source§impl<T, C> FromIterator<T> for RcX<[T], C>where
Cell<C>: RefCount,
impl<T, C> FromIterator<T> for RcX<[T], C>where Cell<C>: RefCount,
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 RcX<T, C>where
Cell<C>: RefCount,
impl<T: ?Sized + Ord, C> Ord for RcX<T, C>where Cell<C>: RefCount,
source§impl<T: ?Sized + PartialEq, C> PartialEq<RcX<T, C>> for RcX<T, C>where
Cell<C>: RefCount,
impl<T: ?Sized + PartialEq, C> PartialEq<RcX<T, C>> for RcX<T, C>where Cell<C>: RefCount,
source§impl<T: ?Sized + PartialOrd, C> PartialOrd<RcX<T, C>> for RcX<T, C>where
Cell<C>: RefCount,
impl<T: ?Sized + PartialOrd, C> PartialOrd<RcX<T, C>> for RcX<T, C>where Cell<C>: RefCount,
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 moreimpl<T: ?Sized + Eq, C> Eq for RcX<T, C>where Cell<C>: RefCount,
Auto Trait Implementations§
impl<T: ?Sized, C> RefUnwindSafe for RcX<T, C>where T: RefUnwindSafe,
impl<T, C> !Send for RcX<T, C>
impl<T, C> !Sync for RcX<T, C>
impl<T: ?Sized, C> Unpin for RcX<T, C>
impl<T: ?Sized, C> UnwindSafe for RcX<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