Struct apollo_encoder::EnumValue
source · [−]pub struct EnumValue { /* private fields */ }
Expand description
The EnumValue type represents one of possible values of an enum.
EnumValueDefinition: Description? EnumValue Directives?
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::{Argument, Directive, EnumValue, Value};
let mut enum_ty = EnumValue::new("CARDBOARD_BOX".to_string());
enum_ty.description(Some("Box nap spot.".to_string()));
let mut deprecated_directive = Directive::new(String::from("deprecated"));
deprecated_directive.arg(Argument::new(
String::from("reason"),
Value::String(String::from(
"Box was recycled.",
)),
));
enum_ty.directive(deprecated_directive);
assert_eq!(
enum_ty.to_string(),
r#" "Box nap spot."
CARDBOARD_BOX @deprecated(reason: "Box was recycled.")"#
);
Implementations
Trait Implementations
impl StructuralPartialEq for EnumValue
Auto Trait Implementations
impl RefUnwindSafe for EnumValue
impl Send for EnumValue
impl Sync for EnumValue
impl Unpin for EnumValue
impl UnwindSafe for EnumValue
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