pub struct TableMeta {
pub name: String,
pub ident: Ident,
pub columns: Vec<ColumnMeta>,
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§
§name: String§ident: Ident§columns: Vec<ColumnMeta>§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 TableMeta
impl TableMeta
pub fn new(ast: &DeriveInput, attrs: &[TableAttr]) -> Self
pub fn from_derive(ast: &DeriveInput) -> Self
pub fn all_fields(&self) -> impl Iterator<Item = &Ident> + '_
pub fn database_columns(&self) -> impl Iterator<Item = &ColumnMeta> + '_
pub fn many_to_one_joins(&self) -> impl Iterator<Item = &ColumnMeta> + '_
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TableMeta
impl RefUnwindSafe for TableMeta
impl Send for TableMeta
impl Sync for TableMeta
impl Unpin for TableMeta
impl UnwindSafe for TableMeta
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