pub struct InputField { /* private fields */ }
Expand description
Input Field in a given Input Object. A GraphQL Input Object defines a set of input fields; the input fields are either scalars, enums, or other input objects. Input fields are similar to Fields, but can have a default value.
§Example
use apollo_encoder::{Type_, InputField};
let ty_1 = Type_::NamedType {
name: "CatBreed".to_string(),
};
let mut field = InputField::new("cat".to_string(), ty_1);
field.default_value("\"Norwegian Forest\"".to_string());
assert_eq!(field.to_string(), r#" cat: CatBreed = "Norwegian Forest""#);
Implementations§
Source§impl InputField
impl InputField
Sourcepub fn description(&mut self, description: String)
pub fn description(&mut self, description: String)
Set the InputField’s description.
Sourcepub fn default_value(&mut self, default_value: String)
pub fn default_value(&mut self, default_value: String)
Set the InputField’s default value.
Trait Implementations§
Source§impl Clone for InputField
impl Clone for InputField
Source§fn clone(&self) -> InputField
fn clone(&self) -> InputField
Returns a copy 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 Debug for InputField
impl Debug for InputField
Source§impl Display for InputField
impl Display for InputField
Source§impl PartialEq for InputField
impl PartialEq for InputField
Source§impl TryFrom<InputValueDefinition> for InputField
impl TryFrom<InputValueDefinition> for InputField
Source§fn try_from(node: InputValueDefinition) -> Result<Self, Self::Error>
fn try_from(node: InputValueDefinition) -> 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 InputField
Auto Trait Implementations§
impl Freeze for InputField
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin for InputField
impl UnwindSafe for InputField
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