Add getters for Document.
This commit is contained in:
parent
47674a6907
commit
93f1bcd744
@ -1,3 +1,4 @@
|
|||||||
|
use super::macros::ref_getter;
|
||||||
use super::Element;
|
use super::Element;
|
||||||
use super::GetStandardProperties;
|
use super::GetStandardProperties;
|
||||||
use super::Object;
|
use super::Object;
|
||||||
@ -8,9 +9,9 @@ pub type HeadlineLevel = u16;
|
|||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Document<'s> {
|
pub struct Document<'s> {
|
||||||
pub source: &'s str,
|
pub(crate) source: &'s str,
|
||||||
pub zeroth_section: Option<Section<'s>>,
|
pub(crate) zeroth_section: Option<Section<'s>>,
|
||||||
pub children: Vec<Heading<'s>>,
|
pub(crate) children: Vec<Heading<'s>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
@ -70,3 +71,8 @@ impl<'s> StandardProperties<'s> for Heading<'s> {
|
|||||||
self.source
|
self.source
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<'s> Document<'s> {
|
||||||
|
ref_getter!(get_zeroth_section, zeroth_section, Option<Section<'s>>);
|
||||||
|
ref_getter!(get_children, children, Vec<Heading<'s>>);
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user