pub trait EntityBase:
'static
+ Send
+ Sized
+ Clone
+ PartialEq
+ Eq
+ Debug {
type ConnectionType: for<'a> DatabaseConnection<'a>;
type AutoGeneratedFields: Default;
const COLLECTION_NAME: &'static str;
// Required methods
fn to_missing_key_err_kind() -> MissingKeyErrorKind;
fn to_transaction_entity(self) -> Entity;
// Provided method
fn downcast<T: EntityBase>(&self) -> Option<&T> { ... }
}
Required Associated Constants§
Sourceconst COLLECTION_NAME: &'static str
const COLLECTION_NAME: &'static str
Beware: if you change the value of this constant on any WASM entity, you’ll need to do a data migration not only because it is used as reference to the object store names but also for the value of the aad.
Required Associated Types§
type ConnectionType: for<'a> DatabaseConnection<'a>
type AutoGeneratedFields: Default
Required Methods§
fn to_missing_key_err_kind() -> MissingKeyErrorKind
fn to_transaction_entity(self) -> Entity
Provided Methods§
fn downcast<T: EntityBase>(&self) -> Option<&T>
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.