DatabaseExt

Trait DatabaseExt 

Source
pub trait DatabaseExt: Database {
    // Required methods
    fn insert_typed<E: Ent>(&self, ent: E) -> DatabaseResult<Id>;
    fn get_typed<E: Ent>(&self, id: Id) -> DatabaseResult<Option<E>>;
    fn get_all_typed<E: Ent>(&self, ids: Vec<Id>) -> DatabaseResult<Vec<E>>;
    fn find_all_typed<E: Ent>(&self, query: Query) -> DatabaseResult<Vec<E>>;
}

Required Methods§

Source

fn insert_typed<E: Ent>(&self, ent: E) -> DatabaseResult<Id>

Inserts an ent of a specific type

Source

fn get_typed<E: Ent>(&self, id: Id) -> DatabaseResult<Option<E>>

Retrieves an ent by id with a specific type

Source

fn get_all_typed<E: Ent>(&self, ids: Vec<Id>) -> DatabaseResult<Vec<E>>

Retrieves ents by id with a specific type

Source

fn find_all_typed<E: Ent>(&self, query: Query) -> DatabaseResult<Vec<E>>

Finds ents that match the specified query and are of the specified type

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§