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: MetaTypeVariant
Actual 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.
Trait Implementations§
Source§impl From<BuildInMeta> for MetaType
impl From<BuildInMeta> for MetaType
Source§fn from(value: BuildInMeta) -> Self
fn from(value: BuildInMeta) -> Self
Converts to this type from the input type.
Source§impl From<ComplexMeta> for MetaType
impl From<ComplexMeta> for MetaType
Source§fn from(value: ComplexMeta) -> Self
fn from(value: ComplexMeta) -> Self
Converts to this type from the input type.
Source§impl From<CustomMeta> for MetaType
impl From<CustomMeta> for MetaType
Source§fn from(value: CustomMeta) -> Self
fn from(value: CustomMeta) -> Self
Converts to this type from the input type.
Source§impl From<DynamicMeta> for MetaType
impl From<DynamicMeta> for MetaType
Source§fn from(value: DynamicMeta) -> Self
fn from(value: DynamicMeta) -> Self
Converts to this type from the input type.
Source§impl From<EnumerationMeta> for MetaType
impl From<EnumerationMeta> for MetaType
Source§fn from(value: EnumerationMeta) -> Self
fn from(value: EnumerationMeta) -> Self
Converts to this type from the input type.
Source§impl From<ReferenceMeta> for MetaType
impl From<ReferenceMeta> for MetaType
Source§fn from(value: ReferenceMeta) -> Self
fn from(value: ReferenceMeta) -> Self
Converts to this type from the input type.
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)
Feeds this value into the given
Hasher
.Source§fn type_eq(&self, other: &Self, types: &MetaTypes) -> bool
fn type_eq(&self, other: &Self, types: &MetaTypes) -> bool
Check if this instance is equal to the
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)
Feeds a slice of this value into the given
Hasher
.Source§fn type_eq_iter<'a, X, Y>(x: X, y: Y, types: &MetaTypes) -> boolwhere
Self: 'a,
X: IntoIterator<Item = &'a Self>,
Y: IntoIterator<Item = &'a Self>,
fn type_eq_iter<'a, X, Y>(x: X, y: Y, types: &MetaTypes) -> boolwhere
Self: 'a,
X: IntoIterator<Item = &'a Self>,
Y: IntoIterator<Item = &'a Self>,
Check if the two passed iterators contain type equal elements.
Auto Trait Implementations§
impl Freeze for MetaType
impl !RefUnwindSafe for MetaType
impl Send for MetaType
impl Sync for MetaType
impl Unpin for MetaType
impl !UnwindSafe for MetaType
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