[−][src]Struct glsp::RRoot
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]
T: RStore,
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]
T: RStore,
impl<T> Debug for RRoot<T> where
T: RStore,
[src]
T: RStore,
impl<T> Display for RRoot<T> where
T: RStore,
[src]
T: RStore,
impl<T> FromVal for RRoot<T> where
T: RStore,
[src]
T: RStore,
fn from_val(val: &Val) -> Result<RRoot<T>, GError>
[src]
fn from_slot(slot: &Slot) -> Result<RRoot<T>, GError>
[src]
impl<T> Pointer for RRoot<T> where
T: RStore,
[src]
T: RStore,
impl<T> ToVal for RRoot<T> where
T: RStore,
[src]
T: RStore,
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]
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<T> From<T> for T
[src]
impl<T> FromElement<Slot> for T where
T: FromVal,
[src]
T: FromVal,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoElement<Slot> for T where
T: ToVal,
[src]
T: ToVal,
impl<T> IntoResult for T where
T: ToVal,
[src]
T: ToVal,
fn into_result(self) -> Result<Slot, GError>
[src]
impl<'a, T> MakeArg<'a> for T where
T: FromVal + MakeTemp<Temp = Slot>,
[src]
T: FromVal + MakeTemp<Temp = Slot>,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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.
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>,