pub struct LayoutPlan { /* private fields */ }Expand description
A declarative, validated layout plan for a document.
Implementations§
Source§impl LayoutPlan
impl LayoutPlan
Sourcepub fn builder(doc: EureDocument) -> PlanBuilder
pub fn builder(doc: EureDocument) -> PlanBuilder
Start a new PlanBuilder for the given document.
Sourcepub fn auto(doc: EureDocument) -> Result<Self, PlanError>
pub fn auto(doc: EureDocument) -> Result<Self, PlanError>
Build a plan using the default automatic policy for every node.
Sourcepub fn sectioned(doc: EureDocument) -> Result<Self, PlanError>
pub fn sectioned(doc: EureDocument) -> Result<Self, PlanError>
Build a plan that emits maps as sections wherever possible.
Sourcepub fn flat(doc: EureDocument) -> Result<Self, PlanError>
pub fn flat(doc: EureDocument) -> Result<Self, PlanError>
Build a plan with no sections — maps become BindingBlock and arrays
of maps become PerElement(BindingBlock).
Sourcepub fn document(&self) -> &EureDocument
pub fn document(&self) -> &EureDocument
Borrow the underlying document.
Sourcepub fn form_of(&self, id: NodeId) -> Option<Form>
pub fn form_of(&self, id: NodeId) -> Option<Form>
Return the assigned Form for a non-Array node.
Sourcepub fn array_form_of(&self, id: NodeId) -> Option<ArrayForm>
pub fn array_form_of(&self, id: NodeId) -> Option<ArrayForm>
Return the assigned ArrayForm for an Array node.
Sourcepub fn order_of(&self, parent: NodeId) -> Option<&[NodeId]>
pub fn order_of(&self, parent: NodeId) -> Option<&[NodeId]>
Return the ordered children override for a parent, if any.
Sourcepub fn emit(self) -> SourceDocument
pub fn emit(self) -> SourceDocument
Emit a crate::source::SourceDocument from this plan.
Trait Implementations§
Source§impl Clone for LayoutPlan
impl Clone for LayoutPlan
Source§fn clone(&self) -> LayoutPlan
fn clone(&self) -> LayoutPlan
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LayoutPlan
impl RefUnwindSafe for LayoutPlan
impl Send for LayoutPlan
impl Sync for LayoutPlan
impl Unpin for LayoutPlan
impl UnsafeUnpin for LayoutPlan
impl UnwindSafe for LayoutPlan
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