cynic_introspection/capabilities.rs
1use crate::SpecificationVersion;
2
3/// The set of capaiblities a GraphQL server supports.
4#[derive(Debug, Default, PartialEq, Eq)]
5pub struct CapabilitySet {
6 pub(super) specification_version: SpecificationVersion,
7}
8
9impl CapabilitySet {
10 /// The version of the GraphQL specification this server supports
11 pub fn version_supported(&self) -> SpecificationVersion {
12 self.specification_version
13 }
14}
15
16impl SpecificationVersion {
17 /// The capabilities of a server that implements this version of the specification
18 pub fn capabilities(self) -> CapabilitySet {
19 CapabilitySet {
20 specification_version: self,
21 }
22 }
23}