pub struct Interpreter<'a> { /* private fields */ }Expand description
The Interpreter transforms raw parsed XML schema data into semantically
meaningful Rust-compatible type metadata.
It operates on a Schemas structure produced by the Parser
and produces a MetaTypes structure, which is the central format used for
code generation.
This abstraction allows the intermediate schema format to be reshaped into a form suitable for deterministic and idiomatic Rust code generation.
Implementations§
Source§impl<'a> Interpreter<'a>
impl<'a> Interpreter<'a>
Sourcepub fn new(schemas: &'a Schemas) -> Self
pub fn new(schemas: &'a Schemas) -> Self
Create a new Interpreter instance using the passed schemas reference.
Sourcepub fn with_typedef<I, T>(self, ident: I, type_: T) -> Result<Self, Error>
pub fn with_typedef<I, T>(self, ident: I, type_: T) -> Result<Self, Error>
Sourcepub fn with_buildin_types(self) -> Result<Self, Error>
pub fn with_buildin_types(self) -> Result<Self, Error>
Sourcepub fn with_default_typedefs(self) -> Result<Self, Error>
pub fn with_default_typedefs(self) -> Result<Self, Error>
Sourcepub fn with_xs_any_type(self) -> Result<Self, Error>
pub fn with_xs_any_type(self) -> Result<Self, Error>
Sourcepub fn with_xs_any_simple_type(self) -> Result<Self, Error>
pub fn with_xs_any_simple_type(self) -> Result<Self, Error>
Sourcepub fn with_qname_type(self) -> Result<Self, Error>
pub fn with_qname_type(self) -> Result<Self, Error>
Add a type definition for xs:QName that uses the
xsd_parser_types::xml::QName type.
Sourcepub fn with_qname_type_from(self, path: &str) -> Result<Self, Error>
pub fn with_qname_type_from(self, path: &str) -> Result<Self, Error>
Add a type definition for xs:QName that uses the type defined at the passed path.
Sourcepub fn with_num_big_int(self) -> Result<Self, Error>
pub fn with_num_big_int(self) -> Result<Self, Error>
Sourcepub fn with_nonzero_typedefs(self) -> Result<Self, Error>
pub fn with_nonzero_typedefs(self) -> Result<Self, Error>
Sourcepub fn with_naming<X>(self, naming: X) -> Selfwhere
X: Naming + 'static,
pub fn with_naming<X>(self, naming: X) -> Selfwhere
X: Naming + 'static,
Set the Naming trait that is used to generate and format names.
This accepts any type that implements the Naming trait.
If you want to use an already boxed version have a look at
with_naming_boxed.
Sourcepub fn with_naming_boxed(self, naming: Box<dyn Naming>) -> Self
pub fn with_naming_boxed(self, naming: Box<dyn Naming>) -> Self
Set the Naming trait that is used to generate and format names.
This accepts only boxed Naming trait. For easier use you can
use with_naming instead.