pub trait Frame {
Show 18 methods
// Required methods
fn allows(&self, local_name: &str, name_table: &NameTable) -> bool;
fn allows_attribute(&self, local_name: &str, name_table: &NameTable) -> bool;
fn on_child_start(&mut self, local_name: &str, name_table: &NameTable);
fn attach(&mut self, child: FrameResult) -> SchemaResult<()>;
fn finish(self: Box<Self>) -> SchemaResult<FrameResult>;
fn source(&self) -> Option<&SourceRef>;
fn set_foreign_attributes(&mut self, attrs: Vec<ForeignAttribute>);
// Provided methods
fn validate_attributes(
&self,
attrs: &AttributeMap,
name_table: &NameTable,
) -> SchemaResult<()> { ... }
fn is_skip_frame(&self) -> bool { ... }
fn children_are_top_level(&self) -> bool { ... }
fn children_inside_complex_type(&self) -> bool { ... }
fn has_annotation(&self) -> bool { ... }
fn on_child_end(&mut self) -> bool { ... }
fn accepts_text(&self) -> bool { ... }
fn accepts_foreign_children(&self) -> bool { ... }
fn on_text(&mut self, _text: &str) { ... }
fn on_cdata(&mut self, _cdata: &str) { ... }
fn set_namespaces(&mut self, _namespaces: NamespaceContextSnapshot) { ... }
}Expand description
Parser frame trait for handling XSD elements
Required Methods§
Sourcefn allows(&self, local_name: &str, name_table: &NameTable) -> bool
fn allows(&self, local_name: &str, name_table: &NameTable) -> bool
Check if a child element is allowed in the current phase
Sourcefn allows_attribute(&self, local_name: &str, name_table: &NameTable) -> bool
fn allows_attribute(&self, local_name: &str, name_table: &NameTable) -> bool
Check if an attribute is allowed on this element
Sourcefn on_child_start(&mut self, local_name: &str, name_table: &NameTable)
fn on_child_start(&mut self, local_name: &str, name_table: &NameTable)
Called when a child element is pushed
Sourcefn attach(&mut self, child: FrameResult) -> SchemaResult<()>
fn attach(&mut self, child: FrameResult) -> SchemaResult<()>
Attach a completed child frame result
Sourcefn finish(self: Box<Self>) -> SchemaResult<FrameResult>
fn finish(self: Box<Self>) -> SchemaResult<FrameResult>
Finish processing and return result
Sourcefn set_foreign_attributes(&mut self, attrs: Vec<ForeignAttribute>)
fn set_foreign_attributes(&mut self, attrs: Vec<ForeignAttribute>)
Set foreign attributes
Provided Methods§
Sourcefn validate_attributes(
&self,
attrs: &AttributeMap,
name_table: &NameTable,
) -> SchemaResult<()>
fn validate_attributes( &self, attrs: &AttributeMap, name_table: &NameTable, ) -> SchemaResult<()>
Validate attributes for this element
Sourcefn is_skip_frame(&self) -> bool
fn is_skip_frame(&self) -> bool
Returns true if this is a SkipFrame (for error recovery depth tracking)
Sourcefn children_are_top_level(&self) -> bool
fn children_are_top_level(&self) -> bool
Returns true if children of this frame are treated as top-level declarations. True for schema, redefine, and override frames.
Sourcefn children_inside_complex_type(&self) -> bool
fn children_inside_complex_type(&self) -> bool
Returns true if children of this frame are inside a <complexType> ancestor
for purposes of src-element §3.3.3 / src-attribute §3.2.3 — i.e. the local
declaration’s targetNamespace may diverge from the schema’s only when there
is a complexType ancestor (and inside it, a restriction of a non-anyType base).
True for the complexType frame and the descendants that propagate the flag.
Sourcefn has_annotation(&self) -> bool
fn has_annotation(&self) -> bool
Returns true if this frame already has an annotation child. Used to reject duplicate annotations per XSD content model.
Sourcefn on_child_end(&mut self) -> bool
fn on_child_end(&mut self) -> bool
Called when leaving a child element in a skip frame Returns true if the skip frame is complete (depth reached 0)
Sourcefn accepts_text(&self) -> bool
fn accepts_text(&self) -> bool
Check if this frame accepts text content
Sourcefn accepts_foreign_children(&self) -> bool
fn accepts_foreign_children(&self) -> bool
Returns true if this frame accepts foreign-namespace child elements.
Defaults to false: only xs:appinfo and xs:documentation (and skip
frames during error recovery) accept arbitrary foreign content.
Sourcefn on_text(&mut self, _text: &str)
fn on_text(&mut self, _text: &str)
Handle text content (for annotation content like appinfo/documentation)
Sourcefn on_cdata(&mut self, _cdata: &str)
fn on_cdata(&mut self, _cdata: &str)
Handle CDATA content (for annotation content like appinfo/documentation)
Sourcefn set_namespaces(&mut self, _namespaces: NamespaceContextSnapshot)
fn set_namespaces(&mut self, _namespaces: NamespaceContextSnapshot)
Set namespace context snapshot (for annotation content)
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl Frame for AlternativeFrame
impl Frame for AnnotationFrame
impl Frame for AnyAttributeFrame
impl Frame for AnyFrame
impl Frame for AppinfoFrame
impl Frame for AssertFrame
impl Frame for AttributeFrame
impl Frame for AttributeGroupFrame
impl Frame for ComplexContentFrame
impl Frame for ComplexTypeFrame
impl Frame for DefaultOpenContentFrame
impl Frame for DocumentationFrame
impl Frame for ElementFrame
impl Frame for ExtensionFrame
impl Frame for FacetFrame
impl Frame for FieldFrame
impl Frame for GroupFrame
impl Frame for IdentityFrame
impl Frame for ImportFrame
impl Frame for IncludeFrame
impl Frame for ListFrame
impl Frame for ModelGroupFrame
impl Frame for NotationFrame
impl Frame for OpenContentFrame
impl Frame for OverrideFrame
xsd11 only.