[][src]Struct glsp_engine::RRoot

pub struct RRoot<T: RStore>(_, _);

A strongly-typed reference to an RData.

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

RRoot tends to be more self-documenting than Root<RData>, and it has a slightly more convenient API.

//using Root
let mesh = player_mesh.borrow::<Mesh>();
let mesh2 = enemy_mesh.take::<Mesh>();

//using RRoot
let mesh = player_mesh.borrow();
let mesh2 = enemy_mesh.take();

Implementations

impl<T: RStore> RRoot<T>[src]

pub fn new(root: Root<RData>) -> RRoot<T>[src]

Constructs an RRoot<T> from a Root<RData>.

Panics if the RData's value does not belong to the type T.

pub fn to_root(&self) -> Root<RData>[src]

Returns a copy of the underlying Root<RData>.

pub fn into_root(self) -> Root<RData>[src]

Drops the RRoot, returning the wrapped Root<RData>.

pub fn ptr_eq(rr0: &RRoot<T>, rr1: &RRoot<T>) -> bool[src]

Returns true if both RRoots refer to the same RData.

pub fn borrow(&self) -> RRef<T>[src]

Equivalent to RData::borrow.

pub fn borrow_mut(&self) -> RRefMut<T>[src]

Equivalent to RData::borrow_mut.

pub fn try_borrow(&self) -> GResult<RRef<T>>[src]

Equivalent to RData::try_borrow.

pub fn try_borrow_mut(&self) -> GResult<RRefMut<T>>[src]

Equivalent to RData::try_borrow_mut.

pub fn take(&self) -> GResult<T>[src]

Equivalent to RData::take.

pub fn free(&self) -> GResult<()>[src]

Equivalent to RData::free.

pub fn is_freed(&self) -> bool[src]

Equivalent to RData::is_freed.

Trait Implementations

impl<T: RStore> Clone for RRoot<T>[src]

impl<T: RStore> Debug for RRoot<T>[src]

impl<T: RStore> Display for RRoot<T>[src]

impl<T: RStore> FromVal for RRoot<T>[src]

impl<T: RStore> Pointer for RRoot<T>[src]

impl<T: RStore> ToVal for RRoot<T>[src]

Auto Trait Implementations

impl<T> !GSend for RRoot<T>

impl<T> !GStore for RRoot<T>

impl<T> !RefUnwindSafe for RRoot<T>

impl<T> !Send for RRoot<T>

impl<T> !Sync for RRoot<T>

impl<T> Unpin for RRoot<T>

impl<T> !UnwindSafe for RRoot<T>

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[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]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.