pub enum Nullability<'src> {
NonNull {
syntax: Option<GraphQLToken<'src>>,
},
Nullable,
}Expand description
The nullability of a type reference.
Rather than modeling NonNullType as a recursive enum variant (which would allow redundant
same-level wrapping like NonNull(NonNull(...))), nullability is flattened into this enum on
each concrete type annotation node.
Multi-level NonNull (e.g. [String!]!) is fully supported: the inner String! is the list’s
element_type (a separate TypeAnnotation with its own
Nullability), and the outer ! is on the
ListTypeAnnotation.
Variants§
NonNull
Fields
§
syntax: Option<GraphQLToken<'src>>The ! token. Present when syntax detail is
retained.
Nullable
Trait Implementations§
Source§impl<'src> Clone for Nullability<'src>
impl<'src> Clone for Nullability<'src>
Source§fn clone(&self) -> Nullability<'src>
fn clone(&self) -> Nullability<'src>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'src> Debug for Nullability<'src>
impl<'src> Debug for Nullability<'src>
Source§impl<'src> PartialEq for Nullability<'src>
impl<'src> PartialEq for Nullability<'src>
impl<'src> StructuralPartialEq for Nullability<'src>
Auto Trait Implementations§
impl<'src> Freeze for Nullability<'src>
impl<'src> RefUnwindSafe for Nullability<'src>
impl<'src> Send for Nullability<'src>
impl<'src> Sync for Nullability<'src>
impl<'src> Unpin for Nullability<'src>
impl<'src> UnsafeUnpin for Nullability<'src>
impl<'src> UnwindSafe for Nullability<'src>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more