pub struct PlanBuilder { /* private fields */ }Expand description
Mutable builder for a LayoutPlan.
Implementations§
Source§impl PlanBuilder
impl PlanBuilder
Sourcepub fn new(doc: EureDocument) -> Self
pub fn new(doc: EureDocument) -> Self
Construct a new builder for the given document.
Sourcepub fn document(&self) -> &EureDocument
pub fn document(&self) -> &EureDocument
Borrow the underlying document.
Sourcepub fn node_at(&self, path: &[PathSegment]) -> Result<NodeId, PlanError>
pub fn node_at(&self, path: &[PathSegment]) -> Result<NodeId, PlanError>
Resolve a path to a NodeId relative to the document root.
Sourcepub fn set_form(
&mut self,
id: NodeId,
form: Form,
) -> Result<&mut Self, PlanError>
pub fn set_form( &mut self, id: NodeId, form: Form, ) -> Result<&mut Self, PlanError>
Assign a Form to a non-Array node.
Sourcepub fn set_form_at(
&mut self,
path: &[PathSegment],
form: Form,
) -> Result<&mut Self, PlanError>
pub fn set_form_at( &mut self, path: &[PathSegment], form: Form, ) -> Result<&mut Self, PlanError>
Assign a Form to the node at the given path.
Sourcepub fn set_array_form(
&mut self,
id: NodeId,
form: ArrayForm,
) -> Result<&mut Self, PlanError>
pub fn set_array_form( &mut self, id: NodeId, form: ArrayForm, ) -> Result<&mut Self, PlanError>
Assign an ArrayForm to an Array node.
Sourcepub fn set_array_form_at(
&mut self,
path: &[PathSegment],
form: ArrayForm,
) -> Result<&mut Self, PlanError>
pub fn set_array_form_at( &mut self, path: &[PathSegment], form: ArrayForm, ) -> Result<&mut Self, PlanError>
Assign an ArrayForm to the Array node at the given path.
Sourcepub fn order(
&mut self,
parent: NodeId,
children: Vec<NodeId>,
) -> Result<&mut Self, PlanError>
pub fn order( &mut self, parent: NodeId, children: Vec<NodeId>, ) -> Result<&mut Self, PlanError>
Order the direct children of a non-Array parent. Unlisted children are appended after the listed ones in document order.
Sourcepub fn order_at(
&mut self,
parent_path: &[PathSegment],
segs: Vec<PathSegment>,
) -> Result<&mut Self, PlanError>
pub fn order_at( &mut self, parent_path: &[PathSegment], segs: Vec<PathSegment>, ) -> Result<&mut Self, PlanError>
Order the direct children of the parent at the given path by child path segments.
Sourcepub fn build(self) -> Result<LayoutPlan, PlanError>
pub fn build(self) -> Result<LayoutPlan, PlanError>
Fill defaults, validate, and finalize.
Trait Implementations§
Source§impl Clone for PlanBuilder
impl Clone for PlanBuilder
Source§fn clone(&self) -> PlanBuilder
fn clone(&self) -> PlanBuilder
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 PlanBuilder
impl RefUnwindSafe for PlanBuilder
impl Send for PlanBuilder
impl Sync for PlanBuilder
impl Unpin for PlanBuilder
impl UnsafeUnpin for PlanBuilder
impl UnwindSafe for PlanBuilder
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