[][src]Struct tiny_ecs::PartMapRef

pub struct PartMapRef<'a, T> { /* fields omitted */ }

Methods

impl<'a, T: 'static> PartMapRef<'a, T>[src]

pub fn new(
    value: &'a RefCell<Box<dyn Any>>
) -> Result<PartMapRef<'a, T>, ECSError>
[src]

Methods from Deref<Target = PartMap<T>>

pub fn get_part_ref(&self, id: u32) -> Result<&T, &'static str>[src]

pub fn iter_ref(&self) -> Iter<u32, T>[src]

Returns an immutable iterator over the part map

Example


let partmap = entities.get_map_ref::<Test1>()
        .expect("No part found for entity");
for (k, v) in partmap.iter_ref() {
    assert!(v.x == *k);
}

Trait Implementations

impl<'a, T> Deref for PartMapRef<'a, T>[src]

type Target = PartMap<T>

The resulting type after dereferencing.

Auto Trait Implementations

impl<'a, T> !Send for PartMapRef<'a, T>

impl<'a, T> !Sync for PartMapRef<'a, T>

Blanket Implementations

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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

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

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