Skip to main content

EntityTable

Trait EntityTable 

Source
pub trait EntityTable<T: Holder<Table = Self>> {
    // Required methods
    fn get_owned(&self, entity_id: u64) -> Result<T::Owned>;
    fn owned_iter<'table>(
        &'table self,
    ) -> Box<dyn Iterator<Item = Result<T::Owned>> + 'table>;
}
Expand description

Trait for tables which pulls an entity (T) from an entity id (u64)

Required Methods§

Source

fn get_owned(&self, entity_id: u64) -> Result<T::Owned>

Get owned entity from table

Source

fn owned_iter<'table>( &'table self, ) -> Box<dyn Iterator<Item = Result<T::Owned>> + 'table>

Get owned entities as an iterator

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§