pub struct GraphQLServerConfig {
pub enabled: Option<bool>,
pub hostname: Option<String>,
pub port: Option<u16>,
pub secure: Option<bool>,
pub ssl_certificate_path: Option<String>,
pub ssl_private_key_path: Option<String>,
pub shutdown_timeout: Option<u64>,
pub workers: Option<usize>,
pub default_context_path: Option<String>,
pub logging: Option<GraphQLLoggingConfig>,
}
Expand description
Configuration for the GraphQL server.
Fields§
§enabled: Option<bool>
If false, the GraphQL server will be disabled.
hostname: Option<String>
The hostname to bind the GraphQL HTTP server.
port: Option<u16>
The port to bind the GraphQL HTTP server.
secure: Option<bool>
If true, HTTPS is enabled.
ssl_certificate_path: Option<String>
The location of the certificate.
ssl_private_key_path: Option<String>
The location of the private key.
shutdown_timeout: Option<u64>
Timeout for graceful workers shutdown in seconds. After receiving a stop signal, workers have this much time to finish serving requests. Workers still alive after the timeout are force dropped. By default shutdown timeout sets to 30 seconds.
workers: Option<usize>
The number of workers to start. The default worker count is the number of physical CPU cores available.
default_context_path: Option<String>
The default context path which redirects the root context to a web resource provider.
logging: Option<GraphQLLoggingConfig>
The logging middleware configuration.
Implementations§
Source§impl GraphQLServerConfig
impl GraphQLServerConfig
pub fn is_enabled(&self) -> bool
pub fn hostname(&self) -> String
pub fn port(&self) -> u16
pub fn address(&self) -> InstanceAddress
pub fn addr(&self) -> String
pub fn url(&self) -> String
pub fn protocol(&self) -> &str
pub fn is_secure(&self) -> bool
pub fn ssl_certificate_path(&self) -> String
pub fn ssl_private_key_path(&self) -> String
pub fn shutdown_timeout(&self) -> u64
pub fn workers(&self) -> usize
pub fn default_context_path(&self) -> Option<String>
Trait Implementations§
Source§impl Clone for GraphQLServerConfig
impl Clone for GraphQLServerConfig
Source§fn clone(&self) -> GraphQLServerConfig
fn clone(&self) -> GraphQLServerConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GraphQLServerConfig
impl Debug for GraphQLServerConfig
Source§impl Default for GraphQLServerConfig
impl Default for GraphQLServerConfig
Source§impl<'de> Deserialize<'de> for GraphQLServerConfig
impl<'de> Deserialize<'de> for GraphQLServerConfig
Source§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
Auto Trait Implementations§
impl Freeze for GraphQLServerConfig
impl RefUnwindSafe for GraphQLServerConfig
impl Send for GraphQLServerConfig
impl Sync for GraphQLServerConfig
impl Unpin for GraphQLServerConfig
impl UnwindSafe for GraphQLServerConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more