pub struct CardSchema {
pub name: String,
pub description: Option<String>,
pub fields: BTreeMap<String, FieldSchema>,
pub ui: Option<UiCardSchema>,
pub body: Option<BodyCardSchema>,
}Expand description
Schema definition for a card type (composable content blocks)
Fields§
§name: StringCard type name (e.g., “indorsements”). The map key carries this on the wire; skipped during serialization to avoid duplication.
description: Option<String>Detailed description of this card type
fields: BTreeMap<String, FieldSchema>List of fields in the card
ui: Option<UiCardSchema>UI layout hints
body: Option<BodyCardSchema>Body namespace: controls whether a body editor is shown and provides optional guide text.
Implementations§
Source§impl CardSchema
impl CardSchema
Sourcepub fn defaults(&self) -> HashMap<String, QuillValue>
pub fn defaults(&self) -> HashMap<String, QuillValue>
Default values declared on this card’s fields, keyed by field name.
Fields with no default are omitted.
Sourcepub fn body_enabled(&self) -> bool
pub fn body_enabled(&self) -> bool
Returns true if body content is permitted for instances of this card.
Defaults to true when no body namespace is declared.
Trait Implementations§
Source§impl Clone for CardSchema
impl Clone for CardSchema
Source§fn clone(&self) -> CardSchema
fn clone(&self) -> CardSchema
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 CardSchema
impl Debug for CardSchema
Source§impl<'de> Deserialize<'de> for CardSchema
impl<'de> Deserialize<'de> for CardSchema
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
Source§impl PartialEq for CardSchema
impl PartialEq for CardSchema
Source§fn eq(&self, other: &CardSchema) -> bool
fn eq(&self, other: &CardSchema) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for CardSchema
impl Serialize for CardSchema
impl StructuralPartialEq for CardSchema
Auto Trait Implementations§
impl Freeze for CardSchema
impl RefUnwindSafe for CardSchema
impl Send for CardSchema
impl Sync for CardSchema
impl Unpin for CardSchema
impl UnsafeUnpin for CardSchema
impl UnwindSafe for CardSchema
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