pub struct RuntimeBuilder<L, R> { /* private fields */ }
Implementations§
Source§impl RuntimeBuilder<SetConfigLocations, NotRunning>
impl RuntimeBuilder<SetConfigLocations, NotRunning>
pub fn new() -> Self
Sourcepub fn instance_config<P: Into<OptionOption<PathBuf>>>(
self,
location: P,
) -> RuntimeBuilder<SetConfigLocations, NotRunning>
pub fn instance_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>
Sets the location of the instance configuration.
Sourcepub fn graphql_server_config<P: Into<OptionOption<PathBuf>>>(
self,
location: P,
) -> RuntimeBuilder<SetConfigLocations, NotRunning>
pub fn graphql_server_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>
Sets the location of the graphql server configuration.
Sourcepub fn plugins_config<P: Into<OptionOption<PathBuf>>>(
self,
location: P,
) -> RuntimeBuilder<SetConfigLocations, NotRunning>
pub fn plugins_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>
Sets the location of the plugins configuration.
Sourcepub async fn load_config_files(
self,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub async fn load_config_files( self, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Loads the config files and transits to state ConfigFilesLoaded
.
Sourcepub fn ignore_config_files(
self,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn ignore_config_files( self, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Doesn’t load the config files. Transits to state ConfigFilesLoaded
.
Source§impl RuntimeBuilder<ConfigFilesLoaded, NotRunning>
impl RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sourcepub fn instance_name<S: Into<OptionOption<String>>>(
self,
name: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn instance_name<S: Into<OptionOption<String>>>( self, name: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the name of the instance.
Sourcepub fn instance_description<S: Into<OptionOption<String>>>(
self,
description: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn instance_description<S: Into<OptionOption<String>>>( self, description: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the description of the instance.
Sourcepub fn hostname<S: Into<OptionOption<String>>>(
self,
hostname: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn hostname<S: Into<OptionOption<String>>>( self, hostname: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the hostname of the GraphQL server.
Sourcepub fn port<S: Into<OptionOption<u16>>>(
self,
port: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn port<S: Into<OptionOption<u16>>>( self, port: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the port number of the GraphQL server.
Sourcepub fn pick_free_port(self) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn pick_free_port(self) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Picks a free port instead of a fixed port number.
Sourcepub fn secure<S: Into<OptionOption<bool>>>(
self,
secure: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn secure<S: Into<OptionOption<bool>>>( self, secure: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets if the GraphQL server shall use https or http.
Sourcepub fn ssl_certificate_path<S: Into<OptionOption<String>>>(
self,
ssl_certificate_path: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn ssl_certificate_path<S: Into<OptionOption<String>>>( self, ssl_certificate_path: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the path to the SSL certificate.
Sourcepub fn ssl_private_key_path<S: Into<OptionOption<String>>>(
self,
ssl_private_key_path: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn ssl_private_key_path<S: Into<OptionOption<String>>>( self, ssl_private_key_path: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the path to the SSL private key.
Sourcepub fn address(
self,
address: &InstanceAddress,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn address( self, address: &InstanceAddress, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the hostname, port and secure of the GraphQL server.
Sourcepub fn shutdown_timeout<S: Into<OptionOption<u64>>>(
self,
shutdown_timeout: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn shutdown_timeout<S: Into<OptionOption<u64>>>( self, shutdown_timeout: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets timeout of the shutdown of the GraphQL server.
Sourcepub fn workers<S: Into<OptionOption<usize>>>(
self,
workers: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn workers<S: Into<OptionOption<usize>>>( self, workers: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the number of workers of the GraphQL server.
Sourcepub fn default_context_path<S: Into<OptionOption<String>>>(
self,
default_context_path: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn default_context_path<S: Into<OptionOption<String>>>( self, default_context_path: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets context path of a web resource provider which shall be used as default context path.
Sourcepub fn disable_all_plugins<S: Into<OptionOption<bool>>>(
self,
disabled: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn disable_all_plugins<S: Into<OptionOption<bool>>>( self, disabled: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Disables all plugins.
Sourcepub fn disabled_plugins<S: Into<OptionOption<Vec<String>>>>(
self,
disabled_plugins: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn disabled_plugins<S: Into<OptionOption<Vec<String>>>>( self, disabled_plugins: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets which plugins will be disabled.
Sourcepub fn enabled_plugins<S: Into<OptionOption<Vec<String>>>>(
self,
enabled_plugins: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn enabled_plugins<S: Into<OptionOption<Vec<String>>>>( self, enabled_plugins: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets which plugins will be enabled. If set, disabled_plugins will have no effect.
Sourcepub fn disable_hot_deploy<S: Into<OptionOption<bool>>>(
self,
disabled: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn disable_hot_deploy<S: Into<OptionOption<bool>>>( self, disabled: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Disables hot deployment of plugins.
Sourcepub fn hot_deploy_location<S: Into<OptionOption<String>>>(
self,
hot_deploy_location: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn hot_deploy_location<S: Into<OptionOption<String>>>( self, hot_deploy_location: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the directory where plugins can be hot deployed.
Sourcepub fn install_location<S: Into<OptionOption<String>>>(
self,
install_location: S,
) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
pub fn install_location<S: Into<OptionOption<String>>>( self, install_location: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>
Sets the directory where plugins are located. During hot deployment new plugins will be moved into this directory.
pub fn get(self) -> Arc<dyn Runtime>
pub async fn init(self) -> RuntimeBuilder<ConfigFilesLoaded, Initialized>
pub async fn block_on(self) -> RuntimeBuilder<ConfigFilesLoaded, Shutdown>
Source§impl RuntimeBuilder<ConfigFilesLoaded, Initialized>
impl RuntimeBuilder<ConfigFilesLoaded, Initialized>
pub async fn post_init(self) -> RuntimeBuilder<ConfigFilesLoaded, Ready>
Source§impl RuntimeBuilder<ConfigFilesLoaded, Ready>
impl RuntimeBuilder<ConfigFilesLoaded, Ready>
pub fn get(self) -> Arc<dyn Runtime>
pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Ready>
Sourcepub async fn spawn(self) -> RuntimeBuilder<ConfigFilesLoaded, Running>
pub async fn spawn(self) -> RuntimeBuilder<ConfigFilesLoaded, Running>
Starts the GraphQL server (non-blocking).
Sourcepub async fn spawn_blocking(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn spawn_blocking(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Starts the GraphQL server (blocking).
Sourcepub async fn run_for(
self,
duration: Duration,
) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn run_for( self, duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Runs starts the GraphQL server. Stops the GraphQL server after the given duration.
Sourcepub async fn do_not_run(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn do_not_run(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Do not start the GraphQL server but shutdown the runtime.
Source§impl RuntimeBuilder<ConfigFilesLoaded, Running>
impl RuntimeBuilder<ConfigFilesLoaded, Running>
pub fn get(self) -> Arc<dyn Runtime + Send + Sync>
pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Running>
Sourcepub async fn stop(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn stop(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Stops the runtime. Waits for the GraphQL server has been stopped.
Sourcepub async fn stop_with_timeout(
self,
timeout_duration: Duration,
) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn stop_with_timeout( self, timeout_duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Stops the runtime. Waits for the GraphQL server has been stopped or the given timeout has been reached.
Sourcepub async fn wait_for_stopped(
self,
) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn wait_for_stopped( self, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Waits for the GraphQL server has been stopped.
Sourcepub async fn wait_for_stopped_with_timeout(
self,
timeout_duration: Duration,
) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn wait_for_stopped_with_timeout( self, timeout_duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
Waits for the GraphQL server has been stopped.
Source§impl RuntimeBuilder<ConfigFilesLoaded, Finished>
impl RuntimeBuilder<ConfigFilesLoaded, Finished>
pub fn get(self) -> Arc<dyn Runtime>
pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
pub async fn pre_shutdown( self, ) -> RuntimeBuilder<ConfigFilesLoaded, PreShutdown>
Source§impl RuntimeBuilder<ConfigFilesLoaded, PreShutdown>
impl RuntimeBuilder<ConfigFilesLoaded, PreShutdown>
pub async fn shutdown(self) -> RuntimeBuilder<ConfigFilesLoaded, Shutdown>
Source§impl RuntimeBuilder<ConfigFilesLoaded, Shutdown>
impl RuntimeBuilder<ConfigFilesLoaded, Shutdown>
pub async fn wait_for( self, duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Shutdown>
Trait Implementations§
Source§impl Default for RuntimeBuilder<SetConfigLocations, NotRunning>
impl Default for RuntimeBuilder<SetConfigLocations, NotRunning>
Auto Trait Implementations§
impl<L, R> Freeze for RuntimeBuilder<L, R>
impl<L, R> !RefUnwindSafe for RuntimeBuilder<L, R>
impl<L, R> Send for RuntimeBuilder<L, R>
impl<L, R> Sync for RuntimeBuilder<L, R>
impl<L, R> Unpin for RuntimeBuilder<L, R>
impl<L, R> !UnwindSafe for RuntimeBuilder<L, R>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more