pub struct CardWriter<'a> { /* private fields */ }Expand description
A single composable card bound to its CardSchema, from
TypedWriter::card. Same set / set_all verbs as TypedWriter.
Implementations§
Source§impl CardWriter<'_>
impl CardWriter<'_>
Sourcepub fn set(
&mut self,
name: &str,
value: impl Into<QuillValue>,
) -> Result<(), EditError>
pub fn set( &mut self, name: &str, value: impl Into<QuillValue>, ) -> Result<(), EditError>
Write a field on this card. Resolves the field against the card’s
CardSchema and strict-commits it; a field the schema does not declare
— or any field when the card kind is unknown — fails with
EditError::UnknownField rather than storing opaquely.
Sourcepub fn set_body(&mut self, markdown: &str) -> Result<(), EditError>
pub fn set_body(&mut self, markdown: &str) -> Result<(), EditError>
Revise this card’s body from markdown (edit semantics), discarding the
delta — the card twin of TypedWriter::set_body.
Sourcepub fn revise_field(
&mut self,
name: &str,
markdown: &str,
) -> Result<Delta, EditError>
pub fn revise_field( &mut self, name: &str, markdown: &str, ) -> Result<Delta, EditError>
Revise a richtext field on this card from markdown — typed and
anchor-preserving; the card twin of TypedWriter::revise_field.
Resolves the field against the card’s CardSchema; an undeclared name —
or any field when the card kind is unknown — fails with
EditError::UnknownField.
Sourcepub fn set_all<K, V, I>(
&mut self,
fields: I,
) -> Result<(), Vec<(String, EditError)>>
pub fn set_all<K, V, I>( &mut self, fields: I, ) -> Result<(), Vec<(String, EditError)>>
Write several fields on this card atomically — see
TypedWriter::set_all; an undeclared name aborts the whole batch with
EditError::UnknownField.