[][src]Struct shine_ecs::resources::named::WriteGuard

pub struct WriteGuard<'a, D> where
    D: Data + 'a, 
{ /* fields omitted */ }

Guarded update access to a store

Methods

impl<'a, D> WriteGuard<'a, D> where
    D: 'a + Data
[src]

pub fn get(&self, k: &<D as Data>::Key) -> Option<Index<D>>[src]

pub fn get_or_add(&mut self, k: &<D as Data>::Key) -> Index<D>[src]

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

Returns if the store is empty.

pub fn finalize_requests(&mut self)[src]

Move all new (pending) resources into the active resources

pub fn drain_unused_filtered<F>(&mut self, filter: F) where
    F: FnMut(&mut D) -> bool
[src]

Drain unreferenced elements those specified by the predicate. In other words, remove all unreferenced resources such that f(&mut data) returns true.

pub fn drain_unused(&mut self)[src]

Drain all unreferenced items. Only the referenced items are kept in the store.

pub fn at(&self, index: &Index<D>) -> &D[src]

pub fn at_mut(&mut self, index: &Index<D>) -> &mut D[src]

Trait Implementations

impl<'a, 'i, D> IndexMut<&'i Index<D>> for WriteGuard<'a, D> where
    D: 'a + Data
[src]

impl<'a, 'i, D> Index<&'i Index<D>> for WriteGuard<'a, D> where
    D: 'a + Data
[src]

type Output = D

The returned type after indexing.

Auto Trait Implementations

impl<'a, D> !Send for WriteGuard<'a, D>

impl<'a, D> !Sync for WriteGuard<'a, D>

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto 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> Borrow for T where
    T: ?Sized
[src]

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

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

impl<T> Any for T where
    T: Any