Struct warpgrapher::engine::config::Configuration
source · [−]Expand description
Fields
model: Vec<Type>
A vector of Type
structures, each defining one type in the data model
Implementations
Creates a new Configuration
data structure with the version, Type
vector, and
Endpoint
vector provided as arguments.
Examples
let c = Configuration::new(1, Vec::new(), Vec::new());
Validates the Configuration
data structure. Checks that there are no duplicate
Endpoint
or Type
items, and that the Endpoint
input/output types are defined
in the model. Returns () if there are no validation errors.
Errors
Returns an Error
variant ConfigItemDuplicated
if there is more than one type or
more than one endpoint that use the same name.
Returns an Error
variant ConfigItemReserved
if a named configuration item, such as
an endpoint or type, has a name that is a reserved word, such as “ID” or the name of a
GraphQL scalar type.
Example
let config = Configuration::new(1, Vec::new(), Vec::new());
config.validate();
Trait Implementations
Returns the “default value” for a type. Read more
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl UnwindSafe for Configuration
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more