pub struct RcX<T: ?Sized, C>(/* private fields */)
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>
impl<T, C> RcX<T, C>
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>
Source§impl<T: ?Sized, C> RcX<T, C>
impl<T: ?Sized, C> RcX<T, C>
Sourcepub fn as_ptr(this: &Self) -> *const T
pub fn as_ptr(this: &Self) -> *const T
See std::rc::Rc::as_ptr.
Sourcepub fn strong_count(this: &Self) -> <Cell<C> as RefCount>::Value
pub fn strong_count(this: &Self) -> <Cell<C> as RefCount>::Value
Sourcepub fn get_mut(this: &mut Self) -> Option<&mut T>
pub fn get_mut(this: &mut Self) -> Option<&mut T>
See std::rc::Rc::get_mut.
Sourcepub fn ptr_eq(this: &Self, other: &Self) -> bool
pub fn ptr_eq(this: &Self, other: &Self) -> bool
See std::rc::Rc::ptr_eq.
Trait Implementations§
Source§impl<T, C> FromIterator<T> for RcX<[T], C>
impl<T, C> FromIterator<T> for RcX<[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 RcX<T, C>
impl<T: ?Sized + Ord, C> Ord for RcX<T, C>
Source§impl<T: ?Sized + PartialOrd, C> PartialOrd for RcX<T, C>
impl<T: ?Sized + PartialOrd, C> PartialOrd for RcX<T, C>
impl<T: ?Sized + Eq, C> Eq for RcX<T, C>
Auto Trait Implementations§
impl<T, C> Freeze for RcX<T, C>where
T: ?Sized,
impl<T, C> RefUnwindSafe for RcX<T, C>where
T: RefUnwindSafe + ?Sized,
impl<T, C> !Send for RcX<T, C>
impl<T, C> !Sync for RcX<T, C>
impl<T, C> Unpin for RcX<T, C>where
T: ?Sized,
impl<T, C> UnwindSafe for RcX<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