pub struct ComplexDataStruct<'types> {
pub base: ComplexBase<'types>,
pub mode: StructMode<'types>,
pub attributes: Vec<ComplexDataAttribute<'types>>,
pub allow_any_attribute: bool,
}Expand description
Represents a rust struct.
Is used as part of the ComplexData.
Fields§
§base: ComplexBase<'types>Basic type information.
mode: StructMode<'types>Additional information about the content of the struct.
attributes: Vec<ComplexDataAttribute<'types>>List of xs:attributes contained in this struct.
allow_any_attribute: boolWhether any kind of attribute is allowed in the struct or not
This is only true if no type for xs:anyAttribute element is defined.
Implementations§
Source§impl<'types> ComplexDataStruct<'types>
impl<'types> ComplexDataStruct<'types>
Sourcepub fn is_unit_struct(&self) -> bool
pub fn is_unit_struct(&self) -> bool
Returns true if this struct is a unit struct, false otherwise.
Sourcepub fn has_attributes(&self) -> bool
pub fn has_attributes(&self) -> bool
Returns true if this struct has attributes, false otherwise.
Sourcepub fn has_content(&self) -> bool
pub fn has_content(&self) -> bool
Returns true if this struct has a content field, false otherwise.
Sourcepub fn elements(&self) -> &[ComplexDataElement<'_>]
pub fn elements(&self) -> &[ComplexDataElement<'_>]
Returns the elements (fields) of this struct.
Sourcepub fn allow_any(&self) -> bool
pub fn allow_any(&self) -> bool
Returns true if any kind of element is allowed in the struct, false otherwise.
Sourcepub fn content(&self) -> Option<&ComplexDataContent<'types>>
pub fn content(&self) -> Option<&ComplexDataContent<'types>>
Returns the content type if this struct has one.
Methods from Deref<Target = ComplexBase<'types>>§
Sourcepub fn is_complex(&self) -> bool
pub fn is_complex(&self) -> bool
true if the type is a complex type, false otherwise.
Sourcepub fn is_dynamic(&self) -> bool
pub fn is_dynamic(&self) -> bool
true if the type is dynamic, false otherwise.
Sourcepub fn is_content(&self) -> bool
pub fn is_content(&self) -> bool
true if the type is the content type of another complex type.
Sourcepub fn element_tag(&self) -> Option<&TagName<'types>>
pub fn element_tag(&self) -> Option<&TagName<'types>>
Returns the name of the element tag, if type is represented by a XML element.
Sourcepub fn represents_element(&self) -> bool
pub fn represents_element(&self) -> bool
Returns true if this type represents an element, false otherwise.