Skip to main content

EntityTypeMeta

Struct EntityTypeMeta 

Source
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: TypeId

The 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.

§navigations: Vec<NavigationMeta>

Navigation properties (relationships) of this entity.

§primary_keys: Vec<Cow<'static, str>>

The name of the primary key property (simplified; multi-key via Vec in practice).

Implementations§

Source§

impl EntityTypeMeta

Source

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.

Source

pub fn find_navigation(&self, field_name: &str) -> Option<&NavigationMeta>

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.

Source

pub fn primary_key_property(&self) -> Option<&PropertyMeta>

Get the primary key property.

Source

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

Source§

fn clone(&self) -> EntityTypeMeta

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EntityTypeMeta

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for EntityTypeMeta

Source§

fn default() -> Self

Produces an empty EntityTypeMeta with lazily-built index caches. type_id defaults to TypeId::of::<()>() since TypeId itself has no Default impl; callers always override it in struct literals via ..EntityTypeMeta::default().

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.