[−][src]Struct gc::GcCell
A mutable memory location with dynamically checked borrow rules that can be used inside of a garbage-collected pointer.
This object is a RefCell
that can be used inside of a Gc<T>
.
Methods
impl<T: Trace> GcCell<T>
[src]
pub fn new(value: T) -> Self
[src]
Creates a new GcCell
containing value
.
pub fn into_inner(self) -> T
[src]
Consumes the GcCell
, returning the wrapped value.
impl<T: Trace + ?Sized> GcCell<T>
[src]
pub fn borrow(&self) -> GcCellRef<T>
[src]
Immutably borrows the wrapped value.
The borrow lasts until the returned GcCellRef
exits scope.
Multiple immutable borrows can be taken out at the same time.
Panics
Panics if the value is currently mutably borrowed.
pub fn borrow_mut(&self) -> GcCellRefMut<T>
[src]
Mutably borrows the wrapped value.
The borrow lasts until the returned GcCellRefMut
exits scope.
The value cannot be borrowed while this borrow is active.
Panics
Panics if the value is currently borrowed.
Trait Implementations
impl<T: Trace + ?Sized> Finalize for GcCell<T>
[src]
impl<T: Trace + ?Sized> Trace for GcCell<T>
[src]
unsafe fn trace(&self)
[src]
unsafe fn root(&self)
[src]
unsafe fn unroot(&self)
[src]
fn finalize_glue(&self)
[src]
impl<T: Trace + ?Sized + Eq> Eq for GcCell<T>
[src]
impl<T: ?Sized + Send> Send for GcCell<T>
[src]
impl<T: Trace + Clone> Clone for GcCell<T>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T: Trace + ?Sized + PartialEq> PartialEq<GcCell<T>> for GcCell<T>
[src]
impl<T: Trace + ?Sized + PartialOrd> PartialOrd<GcCell<T>> for GcCell<T>
[src]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
fn lt(&self, other: &Self) -> bool
[src]
fn le(&self, other: &Self) -> bool
[src]
fn gt(&self, other: &Self) -> bool
[src]
fn ge(&self, other: &Self) -> bool
[src]
impl<T: Trace + ?Sized + Ord> Ord for GcCell<T>
[src]
fn cmp(&self, other: &GcCell<T>) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<T: Trace + Default> Default for GcCell<T>
[src]
impl<T: Trace + ?Sized + Debug> Debug for GcCell<T>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
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 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 for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,