Struct apollo_encoder::ScalarDefinition
source · [−]pub struct ScalarDefinition { /* private fields */ }
Expand description
Represents scalar types such as Int, String, and Boolean. Scalars cannot have fields.
ScalarTypeDefinition: Description? scalar Name Directives?
Detailed documentation can be found in GraphQL spec.
Example
use apollo_encoder::ScalarDefinition;
let mut scalar = ScalarDefinition::new("NumberOfTreatsPerDay".to_string());
scalar.description(Some(
"Int representing number of treats received.".to_string(),
));
assert_eq!(
scalar.to_string(),
r#""Int representing number of treats received."
scalar NumberOfTreatsPerDay
"#
);
Implementations
sourceimpl ScalarDefinition
impl ScalarDefinition
sourcepub fn description(&mut self, description: Option<String>)
pub fn description(&mut self, description: Option<String>)
Set the ScalarDef’s description.
Trait Implementations
sourceimpl Clone for ScalarDefinition
impl Clone for ScalarDefinition
sourcefn clone(&self) -> ScalarDefinition
fn clone(&self) -> ScalarDefinition
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 ScalarDefinition
impl Debug for ScalarDefinition
sourceimpl Display for ScalarDefinition
impl Display for ScalarDefinition
sourceimpl PartialEq<ScalarDefinition> for ScalarDefinition
impl PartialEq<ScalarDefinition> for ScalarDefinition
sourcefn eq(&self, other: &ScalarDefinition) -> bool
fn eq(&self, other: &ScalarDefinition) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ScalarDefinition) -> bool
fn ne(&self, other: &ScalarDefinition) -> bool
This method tests for !=
.
impl StructuralPartialEq for ScalarDefinition
Auto Trait Implementations
impl RefUnwindSafe for ScalarDefinition
impl Send for ScalarDefinition
impl Sync for ScalarDefinition
impl Unpin for ScalarDefinition
impl UnwindSafe for ScalarDefinition
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