pub struct EntityRegistration {
pub type_id: TypeId,
pub type_name: &'static str,
pub meta_fn: fn() -> EntityTypeMeta,
pub context_key: Option<&'static str>,
}Expand description
Type-erased registration for an entity type.
Emitted automatically by #[derive(EntityType)]. Collected at link time
via inventory::collect!, so every entity type compiled into the final
binary is visible to DbContext::discover_entities().
Fields§
§type_id: TypeId§type_name: &'static str§meta_fn: fn() -> EntityTypeMeta§context_key: Option<&'static str>Which DbContext key this entity belongs to.
None = default context; Some("key") = keyed context.
Set by #[context("key")] on the entity struct.
Implementations§
Source§impl EntityRegistration
impl EntityRegistration
pub fn meta(&self) -> EntityTypeMeta
Trait Implementations§
impl Collect for EntityRegistration
Auto Trait Implementations§
impl Freeze for EntityRegistration
impl RefUnwindSafe for EntityRegistration
impl Send for EntityRegistration
impl Sync for EntityRegistration
impl Unpin for EntityRegistration
impl UnsafeUnpin for EntityRegistration
impl UnwindSafe for EntityRegistration
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more