pub enum FrontmatterItem {
Field {
key: String,
value: QuillValue,
fill: bool,
},
Comment {
text: String,
inline: bool,
},
}Expand description
One entry in a Frontmatter: a field or a comment line.
Variants§
Field
A YAML field (key-value pair), optionally tagged !fill.
Fields
§
value: QuillValueComment
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 field that immediately precedes it
in the items vector; if no such field exists at emit time (orphan)
it degrades to an own-line comment. A Comment { inline: true } at
items[0] instead attaches to the sentinel line (QUILL: … /
CARD: …).
Implementations§
Source§impl FrontmatterItem
impl FrontmatterItem
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.
Sourcepub fn comment_inline(text: impl Into<String>) -> Self
pub fn comment_inline(text: impl Into<String>) -> Self
Build an inline (trailing) comment item. Attaches to the previous field on emit; degrades to own-line if none exists.
Trait Implementations§
Source§impl Clone for FrontmatterItem
impl Clone for FrontmatterItem
Source§fn clone(&self) -> FrontmatterItem
fn clone(&self) -> FrontmatterItem
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 FrontmatterItem
impl Debug for FrontmatterItem
Source§impl<'de> Deserialize<'de> for FrontmatterItem
impl<'de> Deserialize<'de> for FrontmatterItem
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 FrontmatterItem
impl PartialEq for FrontmatterItem
Source§fn eq(&self, other: &FrontmatterItem) -> bool
fn eq(&self, other: &FrontmatterItem) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FrontmatterItem
impl Serialize for FrontmatterItem
impl StructuralPartialEq for FrontmatterItem
Auto Trait Implementations§
impl Freeze for FrontmatterItem
impl RefUnwindSafe for FrontmatterItem
impl Send for FrontmatterItem
impl Sync for FrontmatterItem
impl Unpin for FrontmatterItem
impl UnsafeUnpin for FrontmatterItem
impl UnwindSafe for FrontmatterItem
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