pub struct FormTree {
pub nodes: Vec<FormNode>,
pub metadata: Vec<FormNodeMeta>,
pub node_ids: HashMap<String, FormNodeId>,
pub variables_scripts: Vec<(Option<String>, String, String)>,
pub any_data_bound: bool,
}Expand description
The form tree: a node-based representation of the merged template+data.
Fields§
§nodes: Vec<FormNode>Nodes in the form tree.
metadata: Vec<FormNodeMeta>Per-node metadata (parallel to nodes).
node_ids: HashMap<String, FormNodeId>Lookup table: XFA id attribute -> FormNodeId.
variables_scripts: Vec<(Option<String>, String, String)>XFA 3.3 §5.5 <variables> <script name="X">…</script> blocks
gathered at merge time. Each entry is (subform_scope, name, body).
subform_scope is None for root-level scripts (globally accessible)
and Some(subform_name) for scripts scoped to a named subform
(accessible as subform.variables.scriptName). Empty in default mode.
any_data_bound: boolTrue when the merger bound at least one field value from the DataDom. False for forms whose datasets contain only server-infrastructure metadata with no template-field bindings. Used by the flatten pipeline to gate data-empty page suppression: pages must not be suppressed when no data binding has occurred (all field values come from template defaults).
Implementations§
Source§impl FormTree
impl FormTree
Sourcepub fn add_node(&mut self, node: FormNode) -> FormNodeId
pub fn add_node(&mut self, node: FormNode) -> FormNodeId
Add a node to the form tree.
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.
Sourcepub fn get(&self, id: FormNodeId) -> &FormNode
pub fn get(&self, id: FormNodeId) -> &FormNode
Get a node by ID.
Sourcepub fn get_mut(&mut self, id: FormNodeId) -> &mut FormNode
pub fn get_mut(&mut self, id: FormNodeId) -> &mut FormNode
Get a mutable reference to a node by ID.
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().