Skip to main content

PlanBuilder

Struct PlanBuilder 

Source
pub struct PlanBuilder { /* private fields */ }
Expand description

Mutable builder for a LayoutPlan.

Implementations§

Source§

impl PlanBuilder

Source

pub fn new(doc: EureDocument) -> Self

Construct a new builder for the given document.

Source

pub fn document(&self) -> &EureDocument

Borrow the underlying document.

Source

pub fn node_at(&self, path: &[PathSegment]) -> Result<NodeId, PlanError>

Resolve a path to a NodeId relative to the document root.

Source

pub fn set_form( &mut self, id: NodeId, form: Form, ) -> Result<&mut Self, PlanError>

Assign a Form to a non-Array node.

Source

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.

Source

pub fn set_array_form( &mut self, id: NodeId, form: ArrayForm, ) -> Result<&mut Self, PlanError>

Assign an ArrayForm to an Array node.

Source

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.

Source

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.

Source

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.

Source

pub fn build(self) -> Result<LayoutPlan, PlanError>

Fill defaults, validate, and finalize.

Trait Implementations§

Source§

impl Clone for PlanBuilder

Source§

fn clone(&self) -> PlanBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.