Struct ormlite_attr::TableMetadata
source · pub struct TableMetadata {
pub table_name: String,
pub struct_name: Ident,
pub columns: Vec<ColumnMetadata>,
pub databases: Vec<String>,
pub pkey: Option<String>,
}Expand description
Metadata used for IntoArguments, TableMeta, and (subset of) Model This structs are constructed from the *Attribute structs in crate::attr.
Fields§
§table_name: String§struct_name: Ident§columns: Vec<ColumnMetadata>§databases: Vec<String>§pkey: Option<String>If you’re using this, consider whether you should be using a ModelMetadata and its pkey, which is not optional, instead.
Implementations§
source§impl TableMetadata
impl TableMetadata
pub fn new(name: &str, columns: Vec<ColumnMetadata>) -> Self
pub fn from_derive(ast: &DeriveInput) -> Result<TableMetadata, SyndecodeError>
pub fn all_fields(&self) -> impl Iterator<Item = &Ident> + '_
pub fn database_columns(&self) -> impl Iterator<Item = &ColumnMetadata> + '_
pub fn many_to_one_joins(&self) -> impl Iterator<Item = &ColumnMetadata> + '_
Trait Implementations§
source§impl Clone for TableMetadata
impl Clone for TableMetadata
source§fn clone(&self) -> TableMetadata
fn clone(&self) -> TableMetadata
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl RefUnwindSafe for TableMetadata
impl Send for TableMetadata
impl Sync for TableMetadata
impl Unpin for TableMetadata
impl UnwindSafe for TableMetadata
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