pub struct FieldSketch {
pub name: &'static str,
pub ty: &'static str,
pub nullable: bool,
pub belongs_to: Option<&'static str>,
}Expand description
One field on a proposed model. Type strings are constrained to
VALID_TYPE_NAMES so the
generated primitive validates without a translation step.
Fields§
§name: &'static str§ty: &'static strString, i64, i32, bool, DateTime. Anything else is
rejected by the executor — keep this constrained.
nullable: bool§belongs_to: Option<&'static str>When set, the wizard renders this field as a foreign key to
the named model (which must appear earlier in models).
FieldType::ty stays i64; the relation is added on top
when the wizard expands the sketch into a primitive.
Trait Implementations§
Source§impl Clone for FieldSketch
impl Clone for FieldSketch
Source§fn clone(&self) -> FieldSketch
fn clone(&self) -> FieldSketch
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FieldSketch
impl Debug for FieldSketch
Source§impl Deserialize<'static> for FieldSketch
impl Deserialize<'static> for FieldSketch
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'static>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for FieldSketch
impl PartialEq for FieldSketch
Source§fn eq(&self, other: &FieldSketch) -> bool
fn eq(&self, other: &FieldSketch) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FieldSketch
impl Serialize for FieldSketch
impl StructuralPartialEq for FieldSketch
Auto Trait Implementations§
impl Freeze for FieldSketch
impl RefUnwindSafe for FieldSketch
impl Send for FieldSketch
impl Sync for FieldSketch
impl Unpin for FieldSketch
impl UnsafeUnpin for FieldSketch
impl UnwindSafe for FieldSketch
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more