pub struct TypeGraph {
pub namespace: String,
pub root_elements: Vec<RootElement>,
pub types: IndexMap<String, TypeDef>,
}Expand description
The complete intermediate representation of a single XSD schema.
§Example
use mx20022_codegen::{xsd, ir};
let schema = xsd::parse_str(r#"<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:example">
<xs:element name="Root" type="RootType"/>
<xs:complexType name="RootType">
<xs:sequence>
<xs:element name="Id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>"#).unwrap();
let graph = ir::lower::lower(&schema).unwrap();
assert_eq!(graph.root_elements.len(), 1);Fields§
§namespace: StringThe targetNamespace from the XSD schema element.
root_elements: Vec<RootElement>Top-level document element declarations (e.g. <xs:element name="AppHdr" …/>).
types: IndexMap<String, TypeDef>All type definitions keyed by their XSD/Rust name, in insertion order.
Trait Implementations§
impl StructuralPartialEq for TypeGraph
Auto Trait Implementations§
impl Freeze for TypeGraph
impl RefUnwindSafe for TypeGraph
impl Send for TypeGraph
impl Sync for TypeGraph
impl Unpin for TypeGraph
impl UnsafeUnpin for TypeGraph
impl UnwindSafe for TypeGraph
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