pub struct Annotation {
pub id: Option<String>,
pub attributes: Vec<ForeignAttribute>,
pub items: Vec<AnnotationItem>,
pub source: Option<SourceRef>,
}Expand description
Annotation - contains appinfo and documentation elements
Annotations can appear on most schema elements and are used for:
- Human documentation
- Machine-readable extensions (JAXB, XBRL, etc.)
Fields§
§id: Option<String>ID attribute
attributes: Vec<ForeignAttribute>Foreign attributes on the annotation element itself
items: Vec<AnnotationItem>Annotation items (appinfo and documentation in order)
source: Option<SourceRef>Source location
Implementations§
Source§impl Annotation
impl Annotation
Sourcepub fn add_appinfo(&mut self, appinfo: AppInfoElement)
pub fn add_appinfo(&mut self, appinfo: AppInfoElement)
Add an appinfo element
Sourcepub fn add_documentation(&mut self, doc: DocumentationElement)
pub fn add_documentation(&mut self, doc: DocumentationElement)
Add a documentation element
Sourcepub fn appinfos(&self) -> impl Iterator<Item = &AppInfoElement>
pub fn appinfos(&self) -> impl Iterator<Item = &AppInfoElement>
Get all appinfo elements
Sourcepub fn documentations(&self) -> impl Iterator<Item = &DocumentationElement>
pub fn documentations(&self) -> impl Iterator<Item = &DocumentationElement>
Get all documentation elements
Sourcepub fn documentation_for_lang(
&self,
lang: &str,
) -> Option<&DocumentationElement>
pub fn documentation_for_lang( &self, lang: &str, ) -> Option<&DocumentationElement>
Get documentation in a specific language
Sourcepub fn add_foreign_attribute(&mut self, attr: ForeignAttribute)
pub fn add_foreign_attribute(&mut self, attr: ForeignAttribute)
Add a foreign attribute
Trait Implementations§
Source§impl Clone for Annotation
impl Clone for Annotation
Source§fn clone(&self) -> Annotation
fn clone(&self) -> Annotation
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 moreSource§impl Debug for Annotation
impl Debug for Annotation
Auto Trait Implementations§
impl Freeze for Annotation
impl RefUnwindSafe for Annotation
impl Send for Annotation
impl Sync for Annotation
impl Unpin for Annotation
impl UnsafeUnpin for Annotation
impl UnwindSafe for Annotation
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