Struct diana::OptionsBuilder[][src]

pub struct OptionsBuilder<C, Q, M, S> where
    C: Any + Send + Sync + Clone,
    Q: Clone + ObjectType + 'static,
    M: Clone + ObjectType + 'static,
    S: Clone + SubscriptionType + 'static, 
{ /* fields omitted */ }
Expand description

A builder-style struct to create an instance of Options idiomatically.

Implementations

Creates a new builder. You’ll need to then call the other methods to set everything up.

Defines the context to pass to all GraphQL resolvers. This is typically a database pool, but it can really be anything that can be safely sent between threads. If you don’t want to use context, you’ll need to set something here anyway (for now).

Defines the JWT secret that will be used to authenticate client tokens and communication with the subscriptions server. This should be randomly generated (see the book).

Defines the blocklevel for the GraphQL endpoint. See AuthBlockLevel for more details.

Defines your custom schema. The query/mutation roots will be inserted into the queries/mutations server/function and the subscription root will be inserted into the subscriptions server. These should be specified using async_graphql as per the book.

Explicitly enables the subscriptions server. You shouldn’t every need to call this, as calling any methods that define settings for the subscriptions server will automatically enable it.

Defines the hsotname on which the subscriptions server will be contacted.

Defines the port on which the subscriptions server will be contacted.

Defines the GraphQL endpoint for the subscriptions server. The GraphiQL playground endpoint inherits from the .playground_endpoint() setting.

Specifies the JWT which will be used by the queries/mutations system to connect to the subscriptions server. This should be generated based off the same secret as you specify for the queries/mutations system (TODO security review of that architecture).

Defines the GraphiQL playground endpoint. In development, this is not required and will default to /graphiql. In production, if this has been set we’ll throw an error at .finish().

Defines the GraphQL endpoint. This is not required, and defaults to /graphql.

Builds the final options, consuming self. This will return an error if you haven’t set something required up.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.