pub struct EntitySpec {
pub record: String,
pub table: String,
pub rows_fn: String,
pub save_fn: String,
pub save_param: String,
pub fields: Vec<FieldSpec>,
}Expand description
One entity’s shape. Names are bespoke per entity (the CRM uses
contacts_from_rows/crm_save_lines, and save-param names
cs/js/xs) — carried here so generation is byte-identical to
the hand form, not normalised.
Fields§
§record: String§table: String§rows_fn: String§save_fn: String§save_param: String§fields: Vec<FieldSpec>Implementations§
Source§impl EntitySpec
impl EntitySpec
Sourcepub fn validate(&self) -> Result<(), String>
pub fn validate(&self) -> Result<(), String>
Reject a spec that would generate corrupt or self-shadowing
code, with a message that names the fix — rather than silently
emitting broken SQL (e.g. a SELECT … ORDER BY id over
columns that include no id) or a type violation inside the
generated code. A well-formed spec is the caller’s to get
right; a malformed one must fail loudly at the seam, never
corrupt the store. (Typical specs pass unchanged: first field
is the id PK, save-param is not a reserved binding.)
Trait Implementations§
Source§impl Clone for EntitySpec
impl Clone for EntitySpec
Source§fn clone(&self) -> EntitySpec
fn clone(&self) -> EntitySpec
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 EntitySpec
impl Debug for EntitySpec
Source§impl<'de> Deserialize<'de> for EntitySpec
impl<'de> Deserialize<'de> for EntitySpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for EntitySpec
impl RefUnwindSafe for EntitySpec
impl Send for EntitySpec
impl Sync for EntitySpec
impl Unpin for EntitySpec
impl UnsafeUnpin for EntitySpec
impl UnwindSafe for EntitySpec
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> 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