pub struct Field { /* private fields */ }
Expand description
The __Field type represents each field in an Object or Interface type.
Field: Alias? Name Arguments? Directives? SelectionSet?
Detailed documentation can be found in GraphQL spec.
§Example
use apollo_encoder::Field;
let mut field = Field::new("myField".to_string());
field.alias(Some("myAlias".to_string()));
assert_eq!(field.to_string(), r#"myAlias: myField"#);
Implementations§
Source§impl Field
impl Field
Sourcepub fn selection_set(&mut self, selection_set: Option<SelectionSet>)
pub fn selection_set(&mut self, selection_set: Option<SelectionSet>)
Set a selection set to a field
Trait Implementations§
Source§impl TryFrom<Field> for Field
impl TryFrom<Field> for Field
Source§fn try_from(node: Field) -> Result<Self, Self::Error>
fn try_from(node: Field) -> Result<Self, Self::Error>
Create an apollo-encoder node from an apollo-parser one.
§Errors
This returns an error if the apollo-parser tree is not valid. The error doesn’t have much context due to TryFrom API constraints: validate the parse tree before using TryFrom if granular errors are important to you.
impl StructuralPartialEq for Field
Auto Trait Implementations§
impl Freeze for Field
impl RefUnwindSafe for Field
impl Send for Field
impl Sync for Field
impl Unpin for Field
impl UnwindSafe for Field
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