Struct apollo_encoder::InputValueDefinition
source · [−]pub struct InputValueDefinition { /* private fields */ }
Expand description
The InputValueDefinition type represents field and directive arguments.
InputValueDefinition: Description? Name : Type DefaultValue? Directives?
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::{Type_, InputValueDefinition};
let ty_1 = Type_::NamedType {
name: "SpaceProgram".to_string(),
};
let ty_2 = Type_::List { ty: Box::new(ty_1) };
let mut value = InputValueDefinition::new("cat".to_string(), ty_2);
value.description(Some("Very good cats".to_string()));
assert_eq!(
value.to_string(),
r#""Very good cats" cat: [SpaceProgram]"#
);
Implementations
sourceimpl InputValueDefinition
impl InputValueDefinition
sourcepub fn description(&mut self, description: Option<String>)
pub fn description(&mut self, description: Option<String>)
Set the InputValueDef’s description.
Trait Implementations
sourceimpl Clone for InputValueDefinition
impl Clone for InputValueDefinition
sourcefn clone(&self) -> InputValueDefinition
fn clone(&self) -> InputValueDefinition
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 InputValueDefinition
impl Debug for InputValueDefinition
sourceimpl Display for InputValueDefinition
impl Display for InputValueDefinition
sourceimpl PartialEq<InputValueDefinition> for InputValueDefinition
impl PartialEq<InputValueDefinition> for InputValueDefinition
sourcefn eq(&self, other: &InputValueDefinition) -> bool
fn eq(&self, other: &InputValueDefinition) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &InputValueDefinition) -> bool
fn ne(&self, other: &InputValueDefinition) -> bool
This method tests for !=
.
impl StructuralPartialEq for InputValueDefinition
Auto Trait Implementations
impl RefUnwindSafe for InputValueDefinition
impl Send for InputValueDefinition
impl Sync for InputValueDefinition
impl Unpin for InputValueDefinition
impl UnwindSafe for InputValueDefinition
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