Struct yarner_lib::Document
source · [−]Expand description
A representation of a Document
of literate code
Fields
nodes: Vec<Node>
The nodes forming the document
newline: String
The newline character(s) used in the sources
Implementations
sourceimpl Document
impl Document
sourcepub fn new(nodes: Vec<Node>, newline: String) -> Self
pub fn new(nodes: Vec<Node>, newline: String) -> Self
Creates a new document with the given nodes
sourcepub fn code_blocks(&self) -> impl Iterator<Item = &CodeBlock>
pub fn code_blocks(&self) -> impl Iterator<Item = &CodeBlock>
Gets all the code blocks of this document
sourcepub fn code_blocks_by_name(&self) -> HashMap<Option<&str>, Vec<&CodeBlock>>
pub fn code_blocks_by_name(&self) -> HashMap<Option<&str>, Vec<&CodeBlock>>
Code blocks, mapped by name
sourcepub fn transclusions(&self) -> impl Iterator<Item = &Transclusion>
pub fn transclusions(&self) -> impl Iterator<Item = &Transclusion>
Gets all the transclusions of this document
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more