Skip to main content

Frame

Trait Frame 

Source
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§

Source

fn allows(&self, local_name: &str, name_table: &NameTable) -> bool

Check if a child element is allowed in the current phase

Source

fn allows_attribute(&self, local_name: &str, name_table: &NameTable) -> bool

Check if an attribute is allowed on this element

Source

fn on_child_start(&mut self, local_name: &str, name_table: &NameTable)

Called when a child element is pushed

Source

fn attach(&mut self, child: FrameResult) -> SchemaResult<()>

Attach a completed child frame result

Source

fn finish(self: Box<Self>) -> SchemaResult<FrameResult>

Finish processing and return result

Source

fn source(&self) -> Option<&SourceRef>

Get the source location

Source

fn set_foreign_attributes(&mut self, attrs: Vec<ForeignAttribute>)

Set foreign attributes

Provided Methods§

Source

fn validate_attributes( &self, attrs: &AttributeMap, name_table: &NameTable, ) -> SchemaResult<()>

Validate attributes for this element

Source

fn is_skip_frame(&self) -> bool

Returns true if this is a SkipFrame (for error recovery depth tracking)

Source

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.

Source

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.

Source

fn has_annotation(&self) -> bool

Returns true if this frame already has an annotation child. Used to reject duplicate annotations per XSD content model.

Source

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)

Source

fn accepts_text(&self) -> bool

Check if this frame accepts text content

Source

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.

Source

fn on_text(&mut self, _text: &str)

Handle text content (for annotation content like appinfo/documentation)

Source

fn on_cdata(&mut self, _cdata: &str)

Handle CDATA content (for annotation content like appinfo/documentation)

Source

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§