pub struct Written {
pub syntax: Syntax,
pub value: Value,
pub key_lines: HashMap<String, usize>,
}Expand description
A frontmatter as written.
use compmd::frontmatter::{Syntax, Written};
let written = Written::of("---\ntitle: Notes\nmd:\n lang: de\n---\n\n# Notes\n").expect("a frontmatter");
assert_eq!(written.syntax, Syntax::Yaml);
assert_eq!(written.value["md"]["lang"], "de");
assert_eq!(written.key_lines["/md/lang"], 4);Fields§
§syntax: SyntaxWhat it is written in.
value: ValueIts value, each mapping’s keys in written order; data imports’ from as written.
key_lines: HashMap<String, usize>The line each key is on, from 1 in the document, by JSON pointer (/md/import/0/from), whose steps are the
keys and indexes as they are.
Implementations§
Trait Implementations§
impl StructuralPartialEq for Written
Auto Trait Implementations§
impl Forget for Written
impl Freeze for Writtenwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Value>: Freeze,
PhantomData<usize>: Freeze,
PhantomData<Bucket<String, Value>>: Freeze,
PhantomData<(String, usize)>: Freeze,
impl Move for Written
impl RefUnwindSafe for Written
impl Send for Written
impl Sync for Written
impl Unpin for Written
impl UnsafeUnpin for Writtenwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
PhantomData<Bucket<String, Value>>: UnsafeUnpin,
PhantomData<(String, usize)>: UnsafeUnpin,
impl UnwindSafe for Written
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more