pub struct DirectiveAnnotation<'src> {
pub arguments: Vec<Argument<'src>>,
pub name: Name<'src>,
pub span: ByteSpan,
pub syntax: Option<Box<DirectiveAnnotationSyntax<'src>>>,
}Expand description
A directive annotation applied to a definition or field
(e.g. @deprecated(reason: "Use newField")).
See Directives in the spec. Note: this represents an applied directive (an annotation), not a directive definition.
Fields§
§arguments: Vec<Argument<'src>>§name: Name<'src>§span: ByteSpan§syntax: Option<Box<DirectiveAnnotationSyntax<'src>>>Implementations§
Source§impl<'src> DirectiveAnnotation<'src>
impl<'src> DirectiveAnnotation<'src>
Sourcepub fn name_value(&self) -> &str
pub fn name_value(&self) -> &str
Returns the name of this directive annotation as a string slice.
Convenience accessor for self.name.value.
Source§impl DirectiveAnnotation<'_>
impl DirectiveAnnotation<'_>
Sourcepub fn append_source(&self, sink: &mut String, source: Option<&str>)
pub fn append_source(&self, sink: &mut String, source: Option<&str>)
Sourcepub fn byte_span(&self) -> ByteSpan
pub fn byte_span(&self) -> ByteSpan
Returns this directive annotation’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Sourcepub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
pub fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Trait Implementations§
Source§impl AstNode for DirectiveAnnotation<'_>
impl AstNode for DirectiveAnnotation<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this directive annotation’s byte-offset span within the source text.
The returned ByteSpan can be resolved to line/column
positions via source_span() or
ByteSpan::resolve().
Source§fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
fn source_span(&self, source_map: &SourceMap<'_>) -> Option<SourceSpan>
Source§impl<'src> Clone for DirectiveAnnotation<'src>
impl<'src> Clone for DirectiveAnnotation<'src>
Source§fn clone(&self) -> DirectiveAnnotation<'src>
fn clone(&self) -> DirectiveAnnotation<'src>
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<'src> Debug for DirectiveAnnotation<'src>
impl<'src> Debug for DirectiveAnnotation<'src>
Source§impl<'src> PartialEq for DirectiveAnnotation<'src>
impl<'src> PartialEq for DirectiveAnnotation<'src>
impl<'src> StructuralPartialEq for DirectiveAnnotation<'src>
Auto Trait Implementations§
impl<'src> Freeze for DirectiveAnnotation<'src>
impl<'src> RefUnwindSafe for DirectiveAnnotation<'src>
impl<'src> Send for DirectiveAnnotation<'src>
impl<'src> Sync for DirectiveAnnotation<'src>
impl<'src> Unpin for DirectiveAnnotation<'src>
impl<'src> UnsafeUnpin for DirectiveAnnotation<'src>
impl<'src> UnwindSafe for DirectiveAnnotation<'src>
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