#[non_exhaustive]pub enum NodeCountError {
Parse {
message: String,
},
NoOperation,
MultipleOperations {
names: Vec<String>,
},
UnboundVariable {
field: String,
argument: PageSizeArgument,
variable: String,
position: Position,
},
PageSizeOutOfRange {
field: String,
argument: PageSizeArgument,
value: i64,
position: Position,
},
PageSizeNotAnInteger {
field: String,
argument: PageSizeArgument,
found: String,
position: Position,
},
UndefinedFragment {
name: String,
position: Position,
},
FragmentCycle {
name: String,
position: Position,
},
Overflow {
field: String,
position: Position,
},
}Expand description
Why a document’s node count could not be computed.
Marked #[non_exhaustive]: a future release may add a variant without that
being a breaking change, so match with a _ => arm.
Every variant’s Display names the field or the document
position at fault, so a consumer can report which part of its query is wrong
without re-parsing the document itself.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Parse
The text is not a GraphQL document.
NoOperation
The document declares no operation, so there is nothing to count.
MultipleOperations
The document declares more than one operation.
node_count counts the operation in a document and
takes no operation name, so it cannot say which one was meant. Split the
document and ask once per operation.
Fields
UnboundVariable
A first:/last: argument names a variable the caller did not bind.
Fields
argument: PageSizeArgumentWhich page-size argument it was.
PageSizeOutOfRange
A first:/last: page size falls outside GitHub’s 1..=100.
Fields
argument: PageSizeArgumentWhich page-size argument it was.
PageSizeNotAnInteger
A first:/last: argument is neither an integer literal nor a variable.
Fields
argument: PageSizeArgumentWhich page-size argument it was.
UndefinedFragment
A spread names a fragment the document does not define.
Fields
FragmentCycle
A fragment spreads itself, directly or through other fragments.
GraphQL forbids this; counting it would not terminate.
Fields
Overflow
The count grew past what a u64 can express.
Reachable only from a document nesting enough maximum-size pages that the
running multiplier overflows — far above NODE_LIMIT,
so such a document is over the limit whatever the exact number would be.
Trait Implementations§
Source§impl Clone for NodeCountError
impl Clone for NodeCountError
Source§fn clone(&self) -> NodeCountError
fn clone(&self) -> NodeCountError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NodeCountError
impl Debug for NodeCountError
Source§impl Display for NodeCountError
impl Display for NodeCountError
impl Eq for NodeCountError
Source§impl Error for NodeCountError
impl Error for NodeCountError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()