pub struct FieldPrimitive {
pub ty: Type,
pub storage_ty: Option<Type>,
pub serialize: Option<SerializeFormat>,
}Expand description
A primitive (non-relation, non-embedded) field type.
Primitive fields map directly to a single database column. They carry the application-level type, an optional storage-type hint for the database driver, and an optional serialization format.
§Examples
use toasty_core::schema::app::FieldPrimitive;
use toasty_core::stmt::Type;
let prim = FieldPrimitive {
ty: Type::String,
storage_ty: None,
serialize: None,
};Fields§
§ty: TypeThe application-level primitive type of this field.
storage_ty: Option<Type>Optional database storage type hint. When set, the driver uses this
type instead of inferring one from ty.
serialize: Option<SerializeFormat>If set, the field value is serialized using the specified format before being written to the database.
Trait Implementations§
Source§impl Clone for FieldPrimitive
impl Clone for FieldPrimitive
Source§fn clone(&self) -> FieldPrimitive
fn clone(&self) -> FieldPrimitive
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 FieldPrimitive
impl RefUnwindSafe for FieldPrimitive
impl Send for FieldPrimitive
impl Sync for FieldPrimitive
impl Unpin for FieldPrimitive
impl UnwindSafe for FieldPrimitive
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