pub struct EnumValue {
pub name: String,
pub description: Option<String>,
pub deprecation_status: DeprecationStatus,
}
Expand description
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.
Implementations
sourceimpl EnumValue
impl EnumValue
sourcepub fn description(self, description: &str) -> EnumValue
pub fn description(self, description: &str) -> EnumValue
Set the description of the enum value
This overwrites the description if any was previously set.
sourcepub fn deprecated(self, reason: Option<&str>) -> Self
pub fn deprecated(self, reason: Option<&str>) -> Self
Set the enum value to be deprecated with an optional reason.
This overwrites the deprecation reason if any was previously set.
Trait Implementations
sourceimpl<S> GraphQLType<S> for EnumValuewhere
S: ScalarValue,
for<'__b> &'__b S: ScalarRefValue<'__b>,
impl<S> GraphQLType<S> for EnumValuewhere
S: ScalarValue,
for<'__b> &'__b S: ScalarRefValue<'__b>,
sourcefn meta<'r>(
info: &Self::TypeInfo,
registry: &mut Registry<'r, S>
) -> MetaType<'r, S>where
for<'__b> &'__b S: ScalarRefValue<'__b>,
S: 'r,
fn meta<'r>(
info: &Self::TypeInfo,
registry: &mut Registry<'r, S>
) -> MetaType<'r, S>where
for<'__b> &'__b S: ScalarRefValue<'__b>,
S: 'r,
The meta type representing this GraphQL type.
sourcefn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
fn concrete_type_name(&self, _: &Self::Context, _: &Self::TypeInfo) -> String
Return the concrete type name for this instance/union. Read more
sourcefn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_field(
&self,
info: &Self::TypeInfo,
field: &str,
args: &Arguments<'_, S>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
Resolve the value of a single field on this type. Read more
sourcefn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
fn resolve_into_type(
&self,
info: &Self::TypeInfo,
type_name: &str,
selection_set: Option<&[Selection<'_, S>]>,
executor: &Executor<'_, Self::Context, S>
) -> ExecutionResult<S>
Resolve this interface or union into a concrete type Read more
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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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