pub struct ReferenceMeta {
pub type_: Ident,
pub nillable: bool,
pub min_occurs: MinOccurs,
pub max_occurs: MaxOccurs,
}Expand description
Type information that defines a reference to another type.
Fields§
§type_: IdentType that is referenced.
nillable: boolWhether the referenced type is nillable or not.
min_occurs: MinOccursMinimum occurrence of the referenced type.
max_occurs: MaxOccursMaximum occurrence of the referenced type.
Implementations§
Source§impl ReferenceMeta
impl ReferenceMeta
Sourcepub fn new<T>(type_: T) -> Self
pub fn new<T>(type_: T) -> Self
Create a new ReferenceMeta instance from the passed type_.
Sourcepub fn is_single(&self) -> bool
pub fn is_single(&self) -> bool
Returns true if this references a single type, false otherwise.
This means that the target type is used exactly once in this reference.
Sourcepub fn is_simple(&self) -> bool
pub fn is_simple(&self) -> bool
Returns true if this references a simple type, false otherwise.
This means that it is more or less just a type definition or renaming of an existing type.
Sourcepub fn min_occurs(self, min: MinOccurs) -> Self
pub fn min_occurs(self, min: MinOccurs) -> Self
Sets the minimum occurrence of the referenced type.
Sourcepub fn max_occurs(self, max: MaxOccurs) -> Self
pub fn max_occurs(self, max: MaxOccurs) -> Self
Sets the maximum occurrence of the referenced type.
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.
Trait Implementations§
Source§impl Clone for ReferenceMeta
impl Clone for ReferenceMeta
Source§fn clone(&self) -> ReferenceMeta
fn clone(&self) -> ReferenceMeta
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReferenceMeta
impl Debug for ReferenceMeta
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 ReferenceMeta
impl TypeEq for ReferenceMeta
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.