pub struct ColumnMeta {
pub name: String,
pub ty: Type,
pub marked_primary_key: bool,
pub has_database_default: bool,
pub ident: Ident,
pub skip: bool,
pub rust_default: Option<String>,
pub join: Option<Join>,
pub json: bool,
}Expand description
All the metadata we can capture about a column
Fields§
§name: StringName of the column in the database
ty: Type§marked_primary_key: boolOnly says whether the primary key is marked (with an attribute). Use table_metadata.primary_key to definitively know the primary key.
has_database_default: bool§ident: IdentIdentifier used in Rust to refer to the column
skip: bool§rust_default: Option<String>§join: Option<Join>§json: boolImplementations§
Source§impl ColumnMeta
impl ColumnMeta
pub fn is_default(&self) -> bool
pub fn from_fields<'a>(fields: impl Iterator<Item = &'a Field>) -> Vec<Self>
pub fn from_syn(ident: &Ident, ty: &Type) -> Self
pub fn is_join(&self) -> bool
pub fn is_join_one(&self) -> bool
pub fn is_join_many(&self) -> bool
pub fn is_option(&self) -> bool
pub fn is_json(&self) -> bool
Sourcepub fn joined_struct_name(&self) -> Option<String>
pub fn joined_struct_name(&self) -> Option<String>
We expect this to only return a Model of some kind.
pub fn joined_model(&self) -> TokenStream
pub fn from_field(f: &Field) -> Self
Trait Implementations§
Source§impl Clone for ColumnMeta
impl Clone for ColumnMeta
Source§fn clone(&self) -> ColumnMeta
fn clone(&self) -> ColumnMeta
Returns a duplicate 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 Freeze for ColumnMeta
impl RefUnwindSafe for ColumnMeta
impl Send for ColumnMeta
impl Sync for ColumnMeta
impl Unpin for ColumnMeta
impl UnwindSafe for ColumnMeta
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