[][src]Struct juniper::meta::EnumValue

pub struct EnumValue {
    pub name: String,
    pub description: Option<String>,
    pub deprecation_status: DeprecationStatus,
}

Metadata for a single value in an enum

Fields

name: String

The name of the enum value

This is the string literal representation of the enum in responses.

description: Option<String>

The optional description of the enum value.

Note: this is not the description of the enum itself; it's the description of this enum value.

deprecation_status: DeprecationStatus

Whether the field is deprecated or not, with an optional reason.

Methods

impl EnumValue[src]

pub fn new(name: &str) -> EnumValue[src]

Construct a new enum value with the provided name

pub fn description(self, description: &str) -> EnumValue[src]

Set the description of the enum value

This overwrites the description if any was previously set.

pub fn deprecated(self, reason: Option<&str>) -> Self[src]

Set the enum value to be deprecated with an optional reason.

This overwrites the deprecation reason if any was previously set.

Trait Implementations

impl Clone for EnumValue[src]

impl Debug for EnumValue[src]

impl<'a, S> GraphQLType<S> for EnumValue where
    S: ScalarValue + 'a,
    &'__b S: ScalarRefValue<'__b>, 
[src]

type Context = ()

The expected context type for this GraphQL type Read more

type TypeInfo = ()

Type that may carry additional schema information Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.