pub struct AttributeDecl {
pub name: NameId,
pub target_namespace: Option<NameId>,
pub source: Option<SourceRef>,
pub scope: DeclarationScope,
pub type_def: Option<SimpleTypeReference>,
pub value_constraint: Option<ValueConstraint>,
pub id: Option<String>,
pub form: Option<FormKind>,
pub inheritable: bool,
}Expand description
Attribute declaration
Represents an xs:attribute declaration, either global or local.
Fields§
§name: NameIdAttribute name
target_namespace: Option<NameId>Target namespace
source: Option<SourceRef>Source location for error reporting
scope: DeclarationScopeDeclaration scope (global or local)
type_def: Option<SimpleTypeReference>Simple type definition (attributes always have simple types)
value_constraint: Option<ValueConstraint>Value constraint (default or fixed)
id: Option<String>ID attribute value
form: Option<FormKind>Form (qualified/unqualified) - for local attributes
inheritable: boolXSD 1.1: Inheritable attribute (§3.2.6, §3.3.5.6)
Implementations§
Source§impl AttributeDecl
impl AttributeDecl
Sourcepub fn new_global(name: NameId, target_namespace: Option<NameId>) -> Self
pub fn new_global(name: NameId, target_namespace: Option<NameId>) -> Self
Create a new global attribute declaration
Sourcepub fn new_local(name: NameId, target_namespace: Option<NameId>) -> Self
pub fn new_local(name: NameId, target_namespace: Option<NameId>) -> Self
Create a new local attribute declaration
Sourcepub fn has_default(&self) -> bool
pub fn has_default(&self) -> bool
Check if this attribute has a default value
Trait Implementations§
Source§impl Clone for AttributeDecl
impl Clone for AttributeDecl
Source§fn clone(&self) -> AttributeDecl
fn clone(&self) -> AttributeDecl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AttributeDecl
impl RefUnwindSafe for AttributeDecl
impl Send for AttributeDecl
impl Sync for AttributeDecl
impl Unpin for AttributeDecl
impl UnsafeUnpin for AttributeDecl
impl UnwindSafe for AttributeDecl
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