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
impl<C, Q, M, S> OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
impl<C, Q, M, S> OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
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.
pub fn jwt_to_connect_to_subscriptions_server(
self,
subscriptions_server_jwt_to_connect: &str
) -> Self
pub fn jwt_to_connect_to_subscriptions_server(
self,
subscriptions_server_jwt_to_connect: &str
) -> Self
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
.
Trait Implementations
impl<C: Clone, Q: Clone, M: Clone, S: Clone> Clone for OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
impl<C: Clone, Q: Clone, M: Clone, S: Clone> Clone for OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
impl<C, Q, M, S> Default for OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
impl<C, Q, M, S> Default for OptionsBuilder<C, Q, M, S> where
C: Any + Send + Sync + Clone,
Q: Clone + ObjectType + 'static,
M: Clone + ObjectType + 'static,
S: Clone + SubscriptionType + 'static,
Auto Trait Implementations
impl<C, Q, M, S> RefUnwindSafe for OptionsBuilder<C, Q, M, S> where
C: RefUnwindSafe,
M: RefUnwindSafe,
Q: RefUnwindSafe,
S: RefUnwindSafe,
impl<C, Q, M, S> Send for OptionsBuilder<C, Q, M, S>
impl<C, Q, M, S> Sync for OptionsBuilder<C, Q, M, S>
impl<C, Q, M, S> UnwindSafe for OptionsBuilder<C, Q, M, S> where
C: UnwindSafe,
M: UnwindSafe,
Q: UnwindSafe,
S: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V