[−][src]Struct glsp_engine::GcVal
Equivalent to Val
, except that it stores weak Gc
pointers rather than strong Root
pointers.
Construct a GcVal
by calling Val::downgrade
. The GcVal
itself is an opaque struct which can't do anything useful. Instead, convert it to a Val
by calling its upgrade
method.
A GcVal
is only useful when you need to store a GameLisp value in an RData
. Val
s may
contain Root
s, and storing a Root
in an RData
would cause a memory leak.
Implementations
impl GcVal
[src]
pub fn upgrade(&self) -> Option<Val>
[src]
Attempts to construct a Val
based on this GcVal
.
Returns None
if this GcVal
points to a heap-allocated object which has been
deallocated by the garbage collector. To prevent this, use
glsp::write_barrier
and
RClassBuilder::trace
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for GcVal
[src]
impl !Send for GcVal
[src]
impl !Sync for GcVal
[src]
impl Unpin for GcVal
[src]
impl !UnwindSafe for GcVal
[src]
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,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,