[][src]Struct glsp::RRoot

pub struct RRoot<T>(_, _)
where
    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> RRoot<T> where
    T: RStore
[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) -> Result<RRef<T>, GError>[src]

Equivalent to RData::try_borrow.

pub fn try_borrow_mut(&self) -> Result<RRefMut<T>, GError>[src]

Equivalent to RData::try_borrow_mut.

pub fn take(&self) -> Result<T, GError>[src]

Equivalent to RData::take.

pub fn free(&self) -> Result<(), GError>[src]

Equivalent to RData::free.

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

Equivalent to RData::is_freed.

Trait Implementations

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

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

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

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

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

impl<T> ToVal for RRoot<T> where
    T: RStore
[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

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

impl<T> FromElement<Slot> for T where
    T: FromVal
[src]

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

impl<T> IntoElement<Slot> for T where
    T: ToVal
[src]

impl<T> IntoResult for T where
    T: ToVal
[src]

impl<'a, T> MakeArg<'a> for T where
    T: FromVal + MakeTemp<Temp = Slot>, 
[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.