[][src]Struct glsp::RGc

pub struct RGc<T>(_, _);

A strongly-typed, weakly-rooted pointer to an RData.

Equivalent to a Gc<RData>, but it enforces that the RData must contain a value of type T.

RGc is to Gc as RRoot is to Root. For more details, consult the documentation of those types.

Construct an RGc by calling RRoot::downgrade. The RGc itself is an opaque struct which can't do anything useful. Instead, convert it to an RRoot by calling its upgrade method.


impl<T> RGc<T>[src]

pub fn upgrade(&self) -> Option<RRoot<T>>[src]

Attempts to construct an RRoot based on this RGc.

Returns None if this RGc 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

impl<T> Clone for RGc<T>[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for RGc<T>[src]

impl<T> !Send for RGc<T>[src]

impl<T> !Sync for RGc<T>[src]

impl<T> Unpin for RGc<T>[src]

impl<T> !UnwindSafe for RGc<T>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> IntoElement<Slot> for T where
    T: IntoVal

impl<T> IntoVal for T where
    T: StaticMarker, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.