[−][src]Struct gcmodule::Cc
A single-threaded reference-counting pointer that integrates with cyclic garbage collection.
See module level documentation for more details.
Methods
impl<T: Trace> Cc<T>
[src]
pub fn new(value: T) -> Cc<T>
[src]
Constructs a new Cc<T>
.
pub fn into_dyn(self) -> Cc<dyn Trace>
[src]
Convert to Cc<dyn Trace>
.
impl<T: Trace + Clone> Cc<T>
[src]
pub fn cow_update(&mut self, update_func: impl FnMut(&mut T))
[src]
Update the value T
in a copy-on-write way.
If the ref count is 1, the value is updated in-place.
Otherwise a new Cc<T>
will be created.
impl Cc<dyn Trace>
[src]
pub fn downcast_ref<T: 'static>(&self) -> Option<&T>
[src]
Attempt to downcast to the specified type.
pub fn downcast<T: Trace>(self) -> Result<Cc<T>, Cc<dyn Trace>>
[src]
Attempt to downcast to the specified Cc<T>
type.
Trait Implementations
impl<T> Clone for Cc<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Default + Trace + 'static> Default for Cc<T>
[src]
impl<T: ?Sized> Deref for Cc<T>
[src]
impl<T: ?Sized> Drop for Cc<T>
[src]
impl<T: Eq> Eq for Cc<T>
[src]
impl<T: Ord> Ord for Cc<T>
[src]
fn cmp(&self, other: &Cc<T>) -> Ordering
[src]
#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<T: PartialEq> PartialEq<Cc<T>> for Cc<T>
[src]
impl<T: PartialOrd> PartialOrd<Cc<T>> for Cc<T>
[src]
fn partial_cmp(&self, other: &Cc<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Cc<T>) -> bool
[src]
fn le(&self, other: &Cc<T>) -> bool
[src]
fn gt(&self, other: &Cc<T>) -> bool
[src]
fn ge(&self, other: &Cc<T>) -> bool
[src]
impl<T: Trace> Trace for Cc<T>
[src]
fn trace(&self, tracer: &mut Tracer)
[src]
fn is_type_tracked() -> bool
[src]
fn as_any(&self) -> Option<&dyn Any>
[src]
impl Trace for Cc<dyn Trace>
[src]
fn trace(&self, tracer: &mut Tracer)
[src]
fn is_type_tracked() -> bool
[src]
fn as_any(&self) -> Option<&dyn Any>
[src]
impl<T: UnwindSafe + ?Sized> UnwindSafe for Cc<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Cc<T>
impl<T> !Send for Cc<T>
impl<T> !Sync for Cc<T>
impl<T: ?Sized> Unpin for Cc<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,