pub struct AttributeMeta {
pub ident: Ident,
pub variant: AttributeMetaVariant,
pub use_: Use,
pub form: FormChoiceType,
pub default: Option<String>,
pub display_name: Option<String>,
pub documentation: Vec<String>,
}
Expand description
Type information that contains data about attribute definitions.
Fields§
§ident: Ident
Identifier of the attribute.
variant: AttributeMetaVariant
Type of the attribute.
use_: Use
Usage of the attribute.
form: FormChoiceType
The form of this attribute.
default: Option<String>
Default value of the attribute.
display_name: Option<String>
Name of the attribute to use inside the generated code.
documentation: Vec<String>
Documentation of the element extracted from xs:documentation
nodes.
Implementations§
Source§impl AttributeMeta
impl AttributeMeta
Sourcepub fn new(ident: Ident, type_: Ident, form: FormChoiceType) -> Self
pub fn new(ident: Ident, type_: Ident, form: FormChoiceType) -> Self
Create a new AttributeMeta
instance from the passed name
and type_
.
Sourcepub fn any(ident: Ident, any: AnyAttributeMeta) -> Self
pub fn any(ident: Ident, any: AnyAttributeMeta) -> Self
Create a new AttributeMeta
instance from for xs:anyAttribute
attributes.
Sourcepub fn is_any(&self) -> bool
pub fn is_any(&self) -> bool
Returns true
if this attribute represents an xs:anyAttribute
, false
otherwise.
Sourcepub fn as_any(&self) -> Option<&AnyAttributeMeta>
pub fn as_any(&self) -> Option<&AnyAttributeMeta>
Returns the AnyAttributeMeta
if this attribute is a xs:anyAttribute
.
Trait Implementations§
Source§impl Clone for AttributeMeta
impl Clone for AttributeMeta
Source§fn clone(&self) -> AttributeMeta
fn clone(&self) -> AttributeMeta
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 AttributeMeta
impl Debug for AttributeMeta
Source§impl TypeEq for AttributeMeta
impl TypeEq for AttributeMeta
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 AttributeMeta
impl RefUnwindSafe for AttributeMeta
impl Send for AttributeMeta
impl Sync for AttributeMeta
impl Unpin for AttributeMeta
impl UnwindSafe for AttributeMeta
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