[−][src]Struct zerogc::cell::GcCell
A Cell
pointing to a garbage collected object.
Either this or a GcRefCell
is needed in order to mutate a garbage collected object,
since garbage collected pointers are otherwise immutable after allocation.
Unlike a regular Cell
this type implements GarbageCollected
,
and may eventually have read/write barriers.
Implementations
impl<T: Trace + Copy> GcCell<T>
[src]
pub fn new(value: T) -> Self
[src]
pub fn get_mut(&mut self) -> &mut T
[src]
pub fn get(&self) -> T
[src]
pub fn set(&self, value: T)
[src]
Trait Implementations
impl<T: Clone + Trace + Copy> Clone for GcCell<T>
[src]
impl<T: Debug + Trace + Copy> Debug for GcCell<T>
[src]
impl<T: Default + Trace + Copy> Default for GcCell<T>
[src]
impl<T: GcSafe + Copy> GcSafe for GcCell<T>
[src]
const NEEDS_DROP: bool
[src]
Since T is Copy, we shouldn't need to be dropped
Still delegating just in case
impl<T: GcSafe + Copy + NullTrace> NullTrace for GcCell<T>
[src]
impl<T: Trace + Copy> Trace for GcCell<T>
[src]
const NEEDS_TRACE: bool
[src]
fn visit<V: GcVisitor>(&mut self, visitor: &mut V) -> Result<(), V::Err>
[src]
impl<T: GcSafe + Copy> TraceImmutable for GcCell<T>
[src]
Since a cell has interior mutablity, it can implement TraceImmutable
even if the interior type is only Trace
Auto Trait Implementations
impl<T> !RefUnwindSafe for GcCell<T>
impl<T> Send for GcCell<T> where
T: Send,
T: Send,
impl<T> !Sync for GcCell<T>
impl<T> Unpin for GcCell<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for GcCell<T> where
T: UnwindSafe,
T: UnwindSafe,
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>,