pub struct ReferenceMeta {
pub type_: Ident,
pub min_occurs: MinOccurs,
pub max_occurs: MaxOccurs,
}
Expand description
Type information that defines a reference to another type.
Fields§
§type_: Ident
Type that is referenced.
min_occurs: MinOccurs
Minimum occurrence of the referenced type.
max_occurs: MaxOccurs
Maximum 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 is a reference references a single 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.
Trait Implementations§
Source§impl Clone for ReferenceMeta
impl Clone for ReferenceMeta
Source§fn clone(&self) -> ReferenceMeta
fn clone(&self) -> ReferenceMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Converts to this type from the input type.
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)
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 ReferenceMeta
impl RefUnwindSafe for ReferenceMeta
impl Send for ReferenceMeta
impl Sync for ReferenceMeta
impl Unpin for ReferenceMeta
impl UnwindSafe for ReferenceMeta
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