pub trait EntLoader {
type Output: Ent;
// Required method
fn load_from_db(
db: WeakDatabaseRc,
id: Id,
) -> DatabaseResult<Option<Self::Output>>;
// Provided methods
fn load_from_db_strict(
db: WeakDatabaseRc,
id: Id,
) -> DatabaseResult<Self::Output> { ... }
fn load(id: Id) -> DatabaseResult<Option<Self::Output>> { ... }
fn load_strict(id: Id) -> DatabaseResult<Self::Output> { ... }
}Expand description
Represents an interface to load some ent from a database
Required Associated Types§
Required Methods§
Sourcefn load_from_db(
db: WeakDatabaseRc,
id: Id,
) -> DatabaseResult<Option<Self::Output>>
fn load_from_db( db: WeakDatabaseRc, id: Id, ) -> DatabaseResult<Option<Self::Output>>
Retrieves the ent instance with the specified id from the provided database, returning none if ent not found
Provided Methods§
Sourcefn load_from_db_strict(
db: WeakDatabaseRc,
id: Id,
) -> DatabaseResult<Self::Output>
fn load_from_db_strict( db: WeakDatabaseRc, id: Id, ) -> DatabaseResult<Self::Output>
Retrieves the ent instance with the specified id from the provided database, converting none into a missing ent error
Sourcefn load(id: Id) -> DatabaseResult<Option<Self::Output>>
fn load(id: Id) -> DatabaseResult<Option<Self::Output>>
Retrieves the ent instance with the specified id from the global database, returning none if ent not found
Sourcefn load_strict(id: Id) -> DatabaseResult<Self::Output>
fn load_strict(id: Id) -> DatabaseResult<Self::Output>
Retrieves the ent instance with the specified id from the global database, converting none into a missing ent error
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.