pub struct ModelSchema {
pub name: String,
pub kind: ModelKind,
pub tag: Option<String>,
pub content: Option<String>,
pub untagged: bool,
pub ts_type: Option<String>,
pub doc: Option<String>,
pub deprecated: bool,
pub fields: Vec<FieldSchema>,
pub invariants: Vec<InvariantSpec>,
pub variants: Vec<VariantSchema>,
pub commands: Vec<CommandSpec>,
}Expand description
Static description of a model for the contract catalog and IDL.
Fields§
§name: String§kind: ModelKind§tag: Option<String>§content: Option<String>§untagged: bool§ts_type: Option<String>§doc: Option<String>Rust /// documentation attached to the model.
deprecated: bool#[deprecated] or #[pactum(deprecated)] marker.
fields: Vec<FieldSchema>§invariants: Vec<InvariantSpec>§variants: Vec<VariantSchema>For non-command enums: variant names and fields.
commands: Vec<CommandSpec>For command enums: one entry per variant.
Implementations§
Source§impl ModelSchema
impl ModelSchema
pub fn struct_model(name: impl Into<String>, fields: Vec<FieldSchema>) -> Self
pub fn command_enum(name: impl Into<String>, commands: Vec<CommandSpec>) -> Self
Trait Implementations§
Source§impl Clone for ModelSchema
impl Clone for ModelSchema
Source§impl Debug for ModelSchema
impl Debug for ModelSchema
Source§impl<'de> Deserialize<'de> for ModelSchema
impl<'de> Deserialize<'de> for ModelSchema
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
impl Eq for ModelSchema
Source§impl PartialEq for ModelSchema
impl PartialEq for ModelSchema
Source§impl Serialize for ModelSchema
impl Serialize for ModelSchema
impl StructuralPartialEq for ModelSchema
Auto Trait Implementations§
impl Forget for ModelSchema
impl Freeze for ModelSchemawhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<FieldSchema>: Freeze,
PhantomData<InvariantSpec>: Freeze,
PhantomData<VariantSchema>: Freeze,
PhantomData<CommandSpec>: Freeze,
impl Move for ModelSchema
impl RefUnwindSafe for ModelSchema
impl Send for ModelSchema
impl Sync for ModelSchema
impl Unpin for ModelSchema
impl UnsafeUnpin for ModelSchemawhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<FieldSchema>: UnsafeUnpin,
PhantomData<InvariantSpec>: UnsafeUnpin,
PhantomData<VariantSchema>: UnsafeUnpin,
PhantomData<CommandSpec>: UnsafeUnpin,
impl UnwindSafe for ModelSchema
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