pub struct DirectiveDefinition<'src> {
pub arguments: Vec<InputValueDefinition<'src>>,
pub description: Option<StringValue<'src>>,
pub locations: Vec<DirectiveLocation<'src>>,
pub name: Name<'src>,
pub repeatable: bool,
pub span: ByteSpan,
pub syntax: Option<Box<DirectiveDefinitionSyntax<'src>>>,
}Expand description
A directive definition.
See Directive Definitions in the spec.
§Spec invariant
The spec grammar requires at least one directive
location. For a spec-valid node, locations is
always non-empty.
Fields§
§arguments: Vec<InputValueDefinition<'src>>§description: Option<StringValue<'src>>§locations: Vec<DirectiveLocation<'src>>§name: Name<'src>§repeatable: bool§span: ByteSpan§syntax: Option<Box<DirectiveDefinitionSyntax<'src>>>Implementations§
Source§impl<'src> DirectiveDefinition<'src>
impl<'src> DirectiveDefinition<'src>
Sourcepub fn name_value(&self) -> &str
pub fn name_value(&self) -> &str
Returns the name of this directive definition as a string slice.
Convenience accessor for self.name.value.
Source§impl DirectiveDefinition<'_>
impl DirectiveDefinition<'_>
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 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 DirectiveDefinition<'_>
impl AstNode for DirectiveDefinition<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this directive 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 DirectiveDefinition<'src>
impl<'src> Clone for DirectiveDefinition<'src>
Source§fn clone(&self) -> DirectiveDefinition<'src>
fn clone(&self) -> DirectiveDefinition<'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 DirectiveDefinition<'src>
impl<'src> Debug for DirectiveDefinition<'src>
Source§impl<'src> PartialEq for DirectiveDefinition<'src>
impl<'src> PartialEq for DirectiveDefinition<'src>
impl<'src> StructuralPartialEq for DirectiveDefinition<'src>
Auto Trait Implementations§
impl<'src> Freeze for DirectiveDefinition<'src>
impl<'src> RefUnwindSafe for DirectiveDefinition<'src>
impl<'src> Send for DirectiveDefinition<'src>
impl<'src> Sync for DirectiveDefinition<'src>
impl<'src> Unpin for DirectiveDefinition<'src>
impl<'src> UnsafeUnpin for DirectiveDefinition<'src>
impl<'src> UnwindSafe for DirectiveDefinition<'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