Skip to main content

EntityDb

Struct EntityDb 

Source
pub struct EntityDb<T: EntityItem + EntityKochFrom<O, S>, O: EntityItem = T, S = (), Is = ()> {
    pub live: GeneId,
    /* private fields */
}

Fields§

§live: GeneId

Implementations§

Source§

impl<S, T: EntityItem + EntityKochFrom<O, S>, O: EntityItem, Is: 'static> EntityDb<T, O, S, Is>

Source

pub fn get_or_add( &mut self, gene: &Gene, entity: &mut T, ) -> Result<(), ShahError>

Source

pub fn get(&mut self, gene: &Gene, entity: &mut T) -> Result<(), ShahError>

Source

pub fn add(&mut self, entity: &mut T) -> Result<(), ShahError>

Source

pub fn count(&mut self) -> Result<EntityCount, ShahError>

Source

pub fn set(&mut self, entity: &mut T) -> Result<(), ShahError>

Source

pub fn keyed(&mut self, key: &Gene, entity: &mut T) -> Result<(), ShahError>

Source

pub fn del(&mut self, gene: &Gene, entity: &mut T) -> Result<(), ShahError>

Source

pub fn list(&mut self, id: GeneId, result: &mut [T]) -> Result<usize, ShahError>

Source§

impl<S, T: EntityItem + EntityKochFrom<O, S>, O: EntityItem, Is: 'static> EntityDb<T, O, S, Is>

Source

pub fn new(path: &str, revision: u16) -> Result<Self, ShahError>

Source§

impl<S, T: EntityItem + EntityKochFrom<O, S>, O: EntityItem, Is: 'static> EntityDb<T, O, S, Is>

Source

pub fn set_koch( &mut self, koch: Option<EntityKoch<T, O, S>>, ) -> Result<(), ShahError>

Source

pub fn set_inspector(&mut self, inspector: EntityInspector<T, Is>)

Source

pub fn set_dead_list_disabled(&mut self, disabled: bool)

Source

pub fn set_work_iter(&mut self, work_iter: usize)

Trait Implementations§

Source§

impl<T: Debug + EntityItem + EntityKochFrom<O, S>, O: Debug + EntityItem, S: Debug, Is: Debug> Debug for EntityDb<T, O, S, Is>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<S, T: EntityItem + EntityKochFrom<O, S>, O: EntityItem, Is: 'static> Worker<2> for EntityDb<T, O, S, Is>

Source§

fn tasks(&mut self) -> &mut TaskList<2, Task<Self>>

Source§

fn work(&mut self) -> Result<Performed, ShahError>

Auto Trait Implementations§

§

impl<T, O = T, S = (), Is = ()> !Freeze for EntityDb<T, O, S, Is>

§

impl<T, O = T, S = (), Is = ()> !RefUnwindSafe for EntityDb<T, O, S, Is>

§

impl<T, O, S, Is> Send for EntityDb<T, O, S, Is>
where S: Send, Is: Send,

§

impl<T, O = T, S = (), Is = ()> !Sync for EntityDb<T, O, S, Is>

§

impl<T, O, S, Is> Unpin for EntityDb<T, O, S, Is>
where T: Unpin, O: Unpin, S: Unpin, Is: Unpin,

§

impl<T, O, S, Is> UnwindSafe for EntityDb<T, O, S, Is>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> AsStatic<T> for T

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<const N: usize, T> ShahState<N> for T
where T: Worker<N>,