pub enum PayloadItem {
Quill {
reference: QuillReference,
},
Kind {
value: String,
},
Id {
value: String,
},
Ext {
value: Map<String, Value>,
nested_comments: Vec<NestedComment>,
},
Field {
key: String,
value: QuillValue,
fill: bool,
nested_comments: Vec<NestedComment>,
},
Comment {
text: String,
inline: bool,
},
}Expand description
One entry in a Payload: a typed $ system metadata entry, a user
field, or a comment line.
PayloadItem is the live in-memory model; it is intentionally not
Serialize/Deserialize. Storage uses the versioned DTOs in
document::dto, and bindings translate to their own wire types.
Variants§
Quill
$quill system metadata, holding the parsed quill reference.
Fields
reference: QuillReferenceKind
$kind system metadata — the card’s kind name.
Id
$id system metadata — opaque identifier.
Ext
$ext system metadata — an opaque mapping reserved for out-of-band
extension data (UI editor state, agent annotations, …). Never
emitted into the plate JSON, always round-trips through Markdown
and the storage DTO. nested_comments carries YAML comments
inside the $ext mapping; paths are relative to the $ext
value tree (the $ext key itself is not part of the path).
Field
A user-defined YAML field, optionally tagged !fill.
nested_comments carries YAML comments inside the field’s value
(only meaningful when the value is a mapping or sequence); paths
are relative to the field’s value tree (the field’s key is
not part of the path).
Comment
A YAML comment. Text excludes the leading # and one optional space.
inline distinguishes own-line comments (# text on a line by
itself) from trailing inline comments (field: value # text). An
inline comment attaches to the item that immediately precedes it
in the items vector; if no such item exists at emit time (orphan)
it degrades to an own-line comment.
Implementations§
Source§impl PayloadItem
impl PayloadItem
Sourcepub fn field(key: impl Into<String>, value: QuillValue) -> Self
pub fn field(key: impl Into<String>, value: QuillValue) -> Self
Build a plain (non-fill) field entry with no nested comments.
Sourcepub fn nested_comments(&self) -> &[NestedComment]
pub fn nested_comments(&self) -> &[NestedComment]
Borrow the field/ext nested-comments slice. Returns &[] for
variants that don’t carry nested comments.
pub fn comment(text: impl Into<String>) -> Self
pub fn comment_inline(text: impl Into<String>) -> Self
Trait Implementations§
Source§impl Clone for PayloadItem
impl Clone for PayloadItem
Source§fn clone(&self) -> PayloadItem
fn clone(&self) -> PayloadItem
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 PayloadItem
impl Debug for PayloadItem
Source§impl From<&PayloadItem> for PayloadItemV0_82_0
impl From<&PayloadItem> for PayloadItemV0_82_0
Source§fn from(item: &PayloadItem) -> Self
fn from(item: &PayloadItem) -> Self
Source§impl PartialEq for PayloadItem
impl PartialEq for PayloadItem
Source§fn eq(&self, other: &PayloadItem) -> bool
fn eq(&self, other: &PayloadItem) -> bool
self and other values to be equal, and is used by ==.