pub struct ElementDecl {Show 15 fields
pub name: NameId,
pub target_namespace: Option<NameId>,
pub source: Option<SourceRef>,
pub scope: DeclarationScope,
pub type_def: Option<TypeReference>,
pub value_constraint: Option<ValueConstraint>,
pub nillable: bool,
pub is_abstract: bool,
pub substitution_group: Option<ElementRef>,
pub disallowed_substitutions: DerivationSet,
pub substitution_group_exclusions: DerivationSet,
pub identity_constraints: Vec<IdentityConstraintKey>,
pub id: Option<String>,
pub type_alternatives: Vec<TypeAlternative>,
pub form: Option<FormKind>,
}Expand description
Element declaration
Represents an xs:element declaration, either global or local.
Fields§
§name: NameIdElement name
target_namespace: Option<NameId>Target namespace
source: Option<SourceRef>Source location for error reporting
scope: DeclarationScopeDeclaration scope (global or local)
type_def: Option<TypeReference>Type definition (resolved or reference)
value_constraint: Option<ValueConstraint>Value constraint (default or fixed)
nillable: boolNillable flag (allows xsi:nil=“true”)
is_abstract: boolAbstract flag (must be substituted)
substitution_group: Option<ElementRef>Substitution group affiliation
disallowed_substitutions: DerivationSetDisallowed substitutions (block attribute)
substitution_group_exclusions: DerivationSetSubstitution group exclusions (final attribute)
identity_constraints: Vec<IdentityConstraintKey>Identity constraints defined on this element
id: Option<String>ID attribute value
type_alternatives: Vec<TypeAlternative>XSD 1.1: Type alternatives (conditional type assignment)
form: Option<FormKind>Form (qualified/unqualified) - for local elements
Implementations§
Source§impl ElementDecl
impl ElementDecl
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 element 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 element declaration
Sourcepub fn is_substitutable(&self) -> bool
pub fn is_substitutable(&self) -> bool
Check if this element can be substituted
Trait Implementations§
Source§impl Clone for ElementDecl
impl Clone for ElementDecl
Source§fn clone(&self) -> ElementDecl
fn clone(&self) -> ElementDecl
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 ElementDecl
impl RefUnwindSafe for ElementDecl
impl Send for ElementDecl
impl Sync for ElementDecl
impl Unpin for ElementDecl
impl UnsafeUnpin for ElementDecl
impl UnwindSafe for ElementDecl
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