pub struct MetaType {
pub variant: MetaTypeVariant,
pub form: Option<FormChoiceType>,
pub schema: Option<SchemaId>,
pub display_name: Option<String>,
pub documentation: Vec<String>,
}Expand description
Represents a fully interpreted type from an XML schema.
This is the core type wrapper used during schema interpretation. It contains
the actual type structure (variant), optional human-readable naming information,
and collected documentation from schema definitions (e.g. xs:documentation).
Fields§
§variant: MetaTypeVariantActual data type this type represents.
form: Option<FormChoiceType>Form for elements of this type.
schema: Option<SchemaId>Id of the schema this type was defined at.
display_name: Option<String>Name to use for rendering instead of the auto generated name.
documentation: Vec<String>Documentation of the type extracted from xs:documentation nodes.
Implementations§
Source§impl MetaType
impl MetaType
Sourcepub fn new(variant: MetaTypeVariant) -> Self
pub fn new(variant: MetaTypeVariant) -> Self
Create a new MetaType instance from the passed variant.
Sourcepub fn form(&self) -> FormChoiceType
pub fn form(&self) -> FormChoiceType
Returns the form element of this type should have.
Sourcepub fn is_emptiable(&self, types: &MetaTypes) -> bool
pub fn is_emptiable(&self, types: &MetaTypes) -> bool
Returns true if this type is emptiable, false otherwise.
Emptiable means that the type may not have any element.
Methods from Deref<Target = MetaTypeVariant>§
Sourcepub fn is_emptiable(&self, types: &MetaTypes) -> bool
pub fn is_emptiable(&self, types: &MetaTypes) -> bool
Returns true if this type is emptiable, false otherwise.
Emptiable means that the type may not have any element, but a simple text value.
Trait Implementations§
Source§impl From<BuildInMeta> for MetaType
impl From<BuildInMeta> for MetaType
Source§fn from(value: BuildInMeta) -> Self
fn from(value: BuildInMeta) -> Self
Source§impl From<ComplexMeta> for MetaType
impl From<ComplexMeta> for MetaType
Source§fn from(value: ComplexMeta) -> Self
fn from(value: ComplexMeta) -> Self
Source§impl From<CustomMeta> for MetaType
impl From<CustomMeta> for MetaType
Source§fn from(value: CustomMeta) -> Self
fn from(value: CustomMeta) -> Self
Source§impl From<DynamicMeta> for MetaType
impl From<DynamicMeta> for MetaType
Source§fn from(value: DynamicMeta) -> Self
fn from(value: DynamicMeta) -> Self
Source§impl From<EnumerationMeta> for MetaType
impl From<EnumerationMeta> for MetaType
Source§fn from(value: EnumerationMeta) -> Self
fn from(value: EnumerationMeta) -> Self
Source§impl From<ReferenceMeta> for MetaType
impl From<ReferenceMeta> for MetaType
Source§fn from(value: ReferenceMeta) -> Self
fn from(value: ReferenceMeta) -> Self
Source§impl TypeEq for MetaType
impl TypeEq for MetaType
Source§fn type_hash<H: Hasher>(&self, hasher: &mut H, types: &MetaTypes)
fn type_hash<H: Hasher>(&self, hasher: &mut H, types: &MetaTypes)
Hasher.Source§fn type_eq(&self, other: &Self, types: &MetaTypes) -> bool
fn type_eq(&self, other: &Self, types: &MetaTypes) -> bool
other instance using the passed
types to resolve identifiers.Source§fn type_hash_slice<H: Hasher>(slice: &[Self], hasher: &mut H, types: &MetaTypes)
fn type_hash_slice<H: Hasher>(slice: &[Self], hasher: &mut H, types: &MetaTypes)
Hasher.