pub struct SeedOverlay {
pub fields: IndexMap<String, QuillValue>,
pub body: Option<String>,
}Expand description
A parsed, per-kind seed overlay: the sparse fields (and optional body)
a newly-added card of a given kind starts with. Built from a $seed[<kind>]
entry of the main card’s Card::seed map via SeedOverlay::from_json,
and layered over the quill’s schema-example seed by
crate::Quill::seed_card (overlay › example › absent). The reserved inner
key $body carries the body override; every other user field becomes an
entry, while any other $-prefixed key is reserved and dropped.
Fields§
§fields: IndexMap<String, QuillValue>Field-value overrides, keyed by field name.
body: Option<String>Body override, when the overlay declares a $body string.
Implementations§
Source§impl SeedOverlay
impl SeedOverlay
Sourcepub fn from_json(value: &Value) -> Option<Self>
pub fn from_json(value: &Value) -> Option<Self>
Parse an overlay from a $seed[<kind>] JSON value, or None when it is
not a mapping. Use this to turn the raw overlay object a consumer reads
from the main card’s $seed map (Card::seed) into a typed overlay to
hand to crate::Quill::seed_card — e.g.
doc.main().seed().and_then(|m| m.get(kind)).and_then(SeedOverlay::from_json).
Trait Implementations§
Source§impl Clone for SeedOverlay
impl Clone for SeedOverlay
Source§fn clone(&self) -> SeedOverlay
fn clone(&self) -> SeedOverlay
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SeedOverlay
impl Debug for SeedOverlay
Source§impl Default for SeedOverlay
impl Default for SeedOverlay
Source§fn default() -> SeedOverlay
fn default() -> SeedOverlay
Source§impl PartialEq for SeedOverlay
impl PartialEq for SeedOverlay
Source§fn eq(&self, other: &SeedOverlay) -> bool
fn eq(&self, other: &SeedOverlay) -> bool
self and other values to be equal, and is used by ==.