Struct apollo_encoder::InputValueDef
source · [−]pub struct InputValueDef { /* 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_, InputValueDef};
let ty_1 = Type_::NamedType {
name: "SpaceProgram".to_string(),
};
let ty_2 = Type_::List { ty: Box::new(ty_1) };
let mut value = InputValueDef::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 InputValueDef
impl InputValueDef
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 InputValueDef
impl Clone for InputValueDef
sourcefn clone(&self) -> InputValueDef
fn clone(&self) -> InputValueDef
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 InputValueDef
impl Debug for InputValueDef
sourceimpl Display for InputValueDef
impl Display for InputValueDef
sourceimpl PartialEq<InputValueDef> for InputValueDef
impl PartialEq<InputValueDef> for InputValueDef
sourcefn eq(&self, other: &InputValueDef) -> bool
fn eq(&self, other: &InputValueDef) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &InputValueDef) -> bool
fn ne(&self, other: &InputValueDef) -> bool
This method tests for !=
.
impl StructuralPartialEq for InputValueDef
Auto Trait Implementations
impl RefUnwindSafe for InputValueDef
impl Send for InputValueDef
impl Sync for InputValueDef
impl Unpin for InputValueDef
impl UnwindSafe for InputValueDef
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub 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.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub 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