Trait EntityName

Source
pub trait EntityName: IdenStatic + Default {
    // Required method
    fn table_name(&self) -> &str;

    // Provided methods
    fn schema_name(&self) -> Option<&str> { ... }
    fn comment(&self) -> Option<&str> { ... }
    fn module_name(&self) -> &str { ... }
    fn table_ref(&self) -> TableRef { ... }
}
Expand description

A Trait for mapping an Entity to a database table

Required Methods§

Source

fn table_name(&self) -> &str

Get the name of the table

Provided Methods§

Source

fn schema_name(&self) -> Option<&str>

Method to get the name for the schema, defaults to Option::None if not set

Source

fn comment(&self) -> Option<&str>

Method to get the comment for the schema, defaults to Option::None if not set

Source

fn module_name(&self) -> &str

Get the name of the module from the invoking self.table_name()

Source

fn table_ref(&self) -> TableRef

Get the TableRef from invoking the self.schema_name()

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.

Implementations on Foreign Types§

Source§

impl EntityName for Entity

Source§

fn schema_name(&self) -> Option<&str>

Source§

fn table_name(&self) -> &str

Source§

fn comment(&self) -> Option<&str>

Implementors§