pub struct FieldDefinition<'src> {
pub parameters: Vec<InputValueDefinition<'src>>,
pub description: Option<StringValue<'src>>,
pub directives: Vec<DirectiveAnnotation<'src>>,
pub field_type: TypeAnnotation<'src>,
pub name: Name<'src>,
pub span: ByteSpan,
pub syntax: Option<Box<FieldDefinitionSyntax<'src>>>,
}Expand description
A field definition within an object type or interface type.
See Field Definitions in the spec.
Fields§
§parameters: Vec<InputValueDefinition<'src>>§description: Option<StringValue<'src>>§directives: Vec<DirectiveAnnotation<'src>>§field_type: TypeAnnotation<'src>§name: Name<'src>§span: ByteSpan§syntax: Option<Box<FieldDefinitionSyntax<'src>>>Implementations§
Source§impl<'src> FieldDefinition<'src>
impl<'src> FieldDefinition<'src>
Sourcepub fn name_value(&self) -> &str
pub fn name_value(&self) -> &str
Returns the name of this field definition as a string slice.
Convenience accessor for self.name.value.
Source§impl FieldDefinition<'_>
impl FieldDefinition<'_>
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 field 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 FieldDefinition<'_>
impl AstNode for FieldDefinition<'_>
Source§fn byte_span(&self) -> ByteSpan
fn byte_span(&self) -> ByteSpan
Returns this field 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 FieldDefinition<'src>
impl<'src> Clone for FieldDefinition<'src>
Source§fn clone(&self) -> FieldDefinition<'src>
fn clone(&self) -> FieldDefinition<'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 FieldDefinition<'src>
impl<'src> Debug for FieldDefinition<'src>
Source§impl<'src> PartialEq for FieldDefinition<'src>
impl<'src> PartialEq for FieldDefinition<'src>
impl<'src> StructuralPartialEq for FieldDefinition<'src>
Auto Trait Implementations§
impl<'src> Freeze for FieldDefinition<'src>
impl<'src> RefUnwindSafe for FieldDefinition<'src>
impl<'src> Send for FieldDefinition<'src>
impl<'src> Sync for FieldDefinition<'src>
impl<'src> Unpin for FieldDefinition<'src>
impl<'src> UnsafeUnpin for FieldDefinition<'src>
impl<'src> UnwindSafe for FieldDefinition<'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