pub struct EnumValueDefinition<'src> {
pub description: Option<StringValue<'src>>,
pub directives: Vec<DirectiveAnnotation<'src>>,
pub name: Name<'src>,
pub span: ByteSpan,
}Expand description
An enum value definition within an enum type.
See Enum Value Definitions in the spec.
Unlike most other AST node types, this struct has no
syntax field. The grammar
(Description? EnumValue Directives[Const]?) contains no
tokens beyond what the child nodes already capture:
the name token is in Name’s syntax, directives in
DirectiveAnnotation’s syntax, and description in
StringValue’s syntax.
Fields§
§description: Option<StringValue<'src>>§directives: Vec<DirectiveAnnotation<'src>>§name: Name<'src>§span: ByteSpanImplementations§
Source§impl<'src> EnumValueDefinition<'src>
impl<'src> EnumValueDefinition<'src>
Sourcepub fn name_value(&self) -> &str
pub fn name_value(&self) -> &str
Returns the name of this enum value definition as a string slice.
Convenience accessor for self.name.value.
Source§impl EnumValueDefinition<'_>
impl EnumValueDefinition<'_>
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 enum value definition’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 EnumValueDefinition<'_>
impl AstNode for EnumValueDefinition<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this enum value definition’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 EnumValueDefinition<'src>
impl<'src> Clone for EnumValueDefinition<'src>
Source§fn clone(&self) -> EnumValueDefinition<'src>
fn clone(&self) -> EnumValueDefinition<'src>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more