[][src]Struct repository::Repo

pub struct Repo { /* fields omitted */ }

A special kind of arena that can support storing multiple data types.

See the module documentation for more details.

Implementations

impl Repo[src]

pub fn transaction_preallocate<TxFn, T, E>(
    &mut self,
    transaction: TxFn
) -> Result<T, E> where
    TxFn: FnOnce(&mut PreallocTx<'_>) -> Result<T, E>, 
[src]

Executes a transaction with preallocation support

See the documentation of PreallocTx for more information.

impl Repo[src]

pub fn new() -> Self[src]

Create a new Repo.

pub fn insert<T: Any>(&mut self, v: T) -> EntityPtr<T>[src]

Add a new value into the repository. Returning a pointer handle to this value.

pub fn insert_for_id<T: Any>(&mut self, v: T) -> EntityId[src]

Add a new value into the repository. Returning an index handle to this value.

pub fn remove<T: Any>(&mut self, entity_ptr: EntityPtr<T>) -> Option<T>[src]

Remove a value from the repository with its pointer handle.

Trait Implementations

impl AsRepoMut for Repo[src]

impl AsRepoRef for Repo[src]

impl Debug for Repo[src]

impl Default for Repo[src]

Auto Trait Implementations

impl !RefUnwindSafe for Repo

impl !Send for Repo

impl !Sync for Repo

impl Unpin for Repo

impl UnwindSafe for Repo

Blanket Implementations

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

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

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

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.