pub struct OperationDefinition<'src> {
pub description: Option<StringValue<'src>>,
pub directives: Vec<DirectiveAnnotation<'src>>,
pub name: Option<Name<'src>>,
pub operation_kind: OperationKind,
pub selection_set: SelectionSet<'src>,
pub shorthand: bool,
pub span: ByteSpan,
pub syntax: Option<Box<OperationDefinitionSyntax<'src>>>,
pub variable_definitions: Vec<VariableDefinition<'src>>,
}Expand description
An operation definition (query, mutation, or subscription).
See Operations in the spec.
Fields§
§description: Option<StringValue<'src>>§directives: Vec<DirectiveAnnotation<'src>>§name: Option<Name<'src>>§operation_kind: OperationKind§selection_set: SelectionSet<'src>§shorthand: booltrue for shorthand queries ({ field })
that omit the query keyword.
span: ByteSpan§syntax: Option<Box<OperationDefinitionSyntax<'src>>>§variable_definitions: Vec<VariableDefinition<'src>>Implementations§
Source§impl<'src> OperationDefinition<'src>
impl<'src> OperationDefinition<'src>
Sourcepub fn name_value(&self) -> Option<&str>
pub fn name_value(&self) -> Option<&str>
Returns the operation name as a string slice, or
None for anonymous (shorthand) operations.
Convenience accessor for self.name.
Source§impl OperationDefinition<'_>
impl OperationDefinition<'_>
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 operation’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 OperationDefinition<'_>
impl AstNode for OperationDefinition<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this operation’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 OperationDefinition<'src>
impl<'src> Clone for OperationDefinition<'src>
Source§fn clone(&self) -> OperationDefinition<'src>
fn clone(&self) -> OperationDefinition<'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 OperationDefinition<'src>
impl<'src> Debug for OperationDefinition<'src>
Source§impl<'src> PartialEq for OperationDefinition<'src>
impl<'src> PartialEq for OperationDefinition<'src>
impl<'src> StructuralPartialEq for OperationDefinition<'src>
Auto Trait Implementations§
impl<'src> Freeze for OperationDefinition<'src>
impl<'src> RefUnwindSafe for OperationDefinition<'src>
impl<'src> Send for OperationDefinition<'src>
impl<'src> Sync for OperationDefinition<'src>
impl<'src> Unpin for OperationDefinition<'src>
impl<'src> UnsafeUnpin for OperationDefinition<'src>
impl<'src> UnwindSafe for OperationDefinition<'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