Enum apollo_encoder::Type_
source · [−]pub enum Type_ {
NonNull {
ty: Box<Type_>,
},
List {
ty: Box<Type_>,
},
NamedType {
name: String,
},
}
Expand description
Convenience Type_ implementation used when creating a Field.
Can be a NamedType
, a NonNull
or a List
.
This enum is resposible for encoding creating values such as String!
, [[[[String]!]!]!]!
, etc.
Example
use apollo_encoder::{Type_};
let field_ty = Type_::NamedType {
name: "String".to_string(),
};
let list = Type_::List {
ty: Box::new(field_ty),
};
let non_null = Type_::NonNull { ty: Box::new(list) };
assert_eq!(non_null.to_string(), "[String]!");
Variants
NonNull
The Non-Null field type.
List
The List field type.
NamedType
Fields
name: String
NamedType type.
The Named field type.
Trait Implementations
impl StructuralPartialEq for Type_
Auto Trait Implementations
impl RefUnwindSafe for Type_
impl Send for Type_
impl Sync for Type_
impl Unpin for Type_
impl UnwindSafe for Type_
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