[−][src]Struct gcmodule::RawCc
Low-level type for Cc<T>
.
Methods
impl<T: Trace> RawCc<T, ObjectSpace>
[src]
pub fn new(value: T) -> Cc<T>
[src]
Constructs a new Cc<T>
in a thread-local storage.
To collect cycles, use collect_thread_cycles
.
impl<T: Trace, O: AbstractObjectSpace> RawCc<T, O>
[src]
impl<T: Trace + Clone> RawCc<T, ObjectSpace>
[src]
pub fn update_with(&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<T: ?Sized, O: AbstractObjectSpace> RawCc<T, O>
[src]
pub fn trace(&self, tracer: &mut Tracer)
[src]
trace
without T: Trace
bound.
Useful for structures with Cc<T>
fields where T
does not implement
Trace
. For example, struct S(Cc<Box<dyn MyTrait>>)
. To implement
Trace
for S
, it can use Cc::trace(&self.0, tracer)
.
impl<T: ?Sized> RawCc<T, ThreadedObjectSpace>
[src]
pub fn borrow(&self) -> ThreadedCcRef<T>
[src]
Immutably borrows the wrapped value.
The borrow lasts until the returned value exits scope.
Trait Implementations
impl<T, O: AbstractObjectSpace> Clone for RawCc<T, O>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for RawCc<T, O>
[src]
impl<T: Debug> Display for RawCc<T, O>
[src]
impl<T: ?Sized, O: AbstractObjectSpace> Drop for RawCc<T, O>
[src]
impl<T: Eq> Eq for RawCc<T, O>
[src]
impl<T: Ord> Ord for RawCc<T, O>
[src]
fn cmp(&self, other: &RawCc<T, O>) -> 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<RawCc<T, ObjectSpace>> for RawCc<T, O>
[src]
impl<T: PartialOrd> PartialOrd<RawCc<T, ObjectSpace>> for RawCc<T, O>
[src]
Auto Trait Implementations
impl<T, O> !RefUnwindSafe for RawCc<T, O>
impl<T, O> !Send for RawCc<T, O>
impl<T, O> !Sync for RawCc<T, O>
impl<T: ?Sized, O> Unpin for RawCc<T, O>
impl<T, O> !UnwindSafe for RawCc<T, O>
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,