pub struct FormTree {
pub nodes: Vec<FormNode>,
pub metadata: Vec<FormNodeMeta>,
pub node_ids: HashMap<String, FormNodeId>,
}Expand description
The form tree: a node-based representation of the merged template+data.
Fields§
§nodes: Vec<FormNode>§metadata: Vec<FormNodeMeta>Per-node metadata (parallel to nodes).
node_ids: HashMap<String, FormNodeId>Lookup table: XFA id attribute -> FormNodeId.
Implementations§
Source§impl FormTree
impl FormTree
pub fn new() -> Self
pub fn add_node(&mut self, node: FormNode) -> FormNodeId
Sourcepub fn add_node_with_meta(
&mut self,
node: FormNode,
meta: FormNodeMeta,
) -> FormNodeId
pub fn add_node_with_meta( &mut self, node: FormNode, meta: FormNodeMeta, ) -> FormNodeId
Add a node together with its metadata. If the meta has an xfa_id,
it is registered in the node_ids lookup table.
pub fn get(&self, id: FormNodeId) -> &FormNode
pub fn get_mut(&mut self, id: FormNodeId) -> &mut FormNode
Sourcepub fn meta(&self, id: FormNodeId) -> &FormNodeMeta
pub fn meta(&self, id: FormNodeId) -> &FormNodeMeta
Access the metadata for a node.
Sourcepub fn meta_mut(&mut self, id: FormNodeId) -> &mut FormNodeMeta
pub fn meta_mut(&mut self, id: FormNodeId) -> &mut FormNodeMeta
Mutably access the metadata for a node.
Sourcepub fn find_by_xfa_id(&self, id: &str) -> Option<FormNodeId>
pub fn find_by_xfa_id(&self, id: &str) -> Option<FormNodeId>
Look up a node by its XFA id attribute.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FormTree
impl RefUnwindSafe for FormTree
impl Send for FormTree
impl Sync for FormTree
impl Unpin for FormTree
impl UnsafeUnpin for FormTree
impl UnwindSafe for FormTree
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