Struct apollo_encoder::InputField
source · [−]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(Some("\"Norwegian Forest\"".to_string()));
assert_eq!(field.to_string(), r#" cat: CatBreed = "Norwegian Forest""#);
Implementations
sourceimpl InputField
impl InputField
sourcepub fn description(&mut self, description: Option<String>)
pub fn description(&mut self, description: Option<String>)
Set the InputField’s description.
Trait Implementations
sourceimpl Clone for InputField
impl Clone for InputField
sourcefn clone(&self) -> InputField
fn clone(&self) -> InputField
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for InputField
impl Debug for InputField
sourceimpl Display for InputField
impl Display for InputField
sourceimpl PartialEq<InputField> for InputField
impl PartialEq<InputField> for InputField
sourcefn eq(&self, other: &InputField) -> bool
fn eq(&self, other: &InputField) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &InputField) -> bool
fn ne(&self, other: &InputField) -> bool
This method tests for !=
.
impl StructuralPartialEq for InputField
Auto Trait Implementations
impl RefUnwindSafe for InputField
impl Send for InputField
impl Sync for InputField
impl Unpin for InputField
impl UnwindSafe for InputField
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more