pub struct EntityTypeMeta {
pub type_id: TypeId,
pub type_name: Cow<'static, str>,
pub table_name: Cow<'static, str>,
pub properties: Vec<PropertyMeta>,
pub navigations: Vec<NavigationMeta>,
pub primary_keys: Vec<Cow<'static, str>>,
/* private fields */
}Expand description
Metadata describing an entity type.
Corresponds to EFCore’s IEntityType.
Fields§
§type_id: TypeIdThe Rust type identifier.
type_name: Cow<'static, str>The Rust struct name.
table_name: Cow<'static, str>The database table name.
properties: Vec<PropertyMeta>Properties (columns) of this entity.
Navigation properties (relationships) of this entity.
primary_keys: Vec<Cow<'static, str>>The name of the primary key property (simplified; multi-key via Vec
Implementations§
Source§impl EntityTypeMeta
impl EntityTypeMeta
Sourcepub fn find_property(&self, field_name: &str) -> Option<&PropertyMeta>
pub fn find_property(&self, field_name: &str) -> Option<&PropertyMeta>
Find a property by field name.
Uses a lazily-built HashMap index for O(1) lookup instead of linear
scan. The index is cached for the lifetime of this EntityTypeMeta;
a cloned meta rebuilds its own index on first access.
Find a navigation by field name.
Uses a lazily-built HashMap index for O(1) lookup instead of linear
scan. The index is cached for the lifetime of this EntityTypeMeta;
a cloned meta rebuilds its own index on first access.
Sourcepub fn primary_key_property(&self) -> Option<&PropertyMeta>
pub fn primary_key_property(&self) -> Option<&PropertyMeta>
Get the primary key property.
Sourcepub fn mapped_scalar_properties(&self) -> impl Iterator<Item = &PropertyMeta>
pub fn mapped_scalar_properties(&self) -> impl Iterator<Item = &PropertyMeta>
Returns properties that are not navigation and not mapped.
Trait Implementations§
Source§impl Clone for EntityTypeMeta
impl Clone for EntityTypeMeta
Source§fn clone(&self) -> EntityTypeMeta
fn clone(&self) -> EntityTypeMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more