pub struct Annotation {
pub data: Data,
pub children: GeneralContainer,
pub location: Range,
}Expand description
An annotation represents some metadata about an AST element.
Fields§
§data: Data§children: GeneralContainer§location: RangeImplementations§
Source§impl Annotation
impl Annotation
pub fn new( label: Label, parameters: Vec<Parameter>, children: Vec<ContentElement>, ) -> Self
pub fn marker(label: Label) -> Self
pub fn with_parameters(label: Label, parameters: Vec<Parameter>) -> Self
pub fn from_data(data: Data, children: Vec<ContentElement>) -> Self
Sourcepub fn header_location(&self) -> &Range
pub fn header_location(&self) -> &Range
Range covering only the annotation header (label + parameters).
Sourcepub fn body_location(&self) -> Option<Range>
pub fn body_location(&self) -> Option<Range>
Bounding range covering only the annotation’s children.
Trait Implementations§
Source§impl AstNode for Annotation
impl AstNode for Annotation
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Container for Annotation
impl Container for Annotation
fn label(&self) -> &str
fn children(&self) -> &[ContentItem]
fn children_mut(&mut self) -> &mut Vec<ContentItem>
Source§impl Debug for Annotation
impl Debug for Annotation
Source§impl Display for Annotation
impl Display for Annotation
Source§impl PartialEq for Annotation
impl PartialEq for Annotation
Source§impl VisualStructure for Annotation
impl VisualStructure for Annotation
Source§fn is_source_line_node(&self) -> bool
fn is_source_line_node(&self) -> bool
Whether this node corresponds to a line in the source document Read more
Source§fn has_visual_header(&self) -> bool
fn has_visual_header(&self) -> bool
Whether this node has a visual header line separate from its content Read more
Source§fn collapses_with_children(&self) -> bool
fn collapses_with_children(&self) -> bool
Whether this is a homogeneous container whose children can collapse with parent icon Read more
impl StructuralPartialEq 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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more