Struct RuntimeBuilder

Source
pub struct RuntimeBuilder<L, R> { /* private fields */ }

Implementations§

Source§

impl RuntimeBuilder<SetConfigLocations, NotRunning>

Source

pub fn new() -> Self

Source

pub fn instance_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>

Sets the location of the instance configuration.

Source

pub fn graphql_server_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>

Sets the location of the graphql server configuration.

Source

pub fn plugins_config<P: Into<OptionOption<PathBuf>>>( self, location: P, ) -> RuntimeBuilder<SetConfigLocations, NotRunning>

Sets the location of the plugins configuration.

Source

pub async fn load_config_files( self, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Loads the config files and transits to state ConfigFilesLoaded.

Source

pub fn ignore_config_files( self, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Doesn’t load the config files. Transits to state ConfigFilesLoaded.

Source§

impl RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Source

pub fn instance_name<S: Into<OptionOption<String>>>( self, name: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the name of the instance.

Source

pub fn instance_description<S: Into<OptionOption<String>>>( self, description: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the description of the instance.

Source

pub fn hostname<S: Into<OptionOption<String>>>( self, hostname: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the hostname of the GraphQL server.

Source

pub fn port<S: Into<OptionOption<u16>>>( self, port: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the port number of the GraphQL server.

Source

pub fn pick_free_port(self) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Picks a free port instead of a fixed port number.

Source

pub fn secure<S: Into<OptionOption<bool>>>( self, secure: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets if the GraphQL server shall use https or http.

Source

pub fn ssl_certificate_path<S: Into<OptionOption<String>>>( self, ssl_certificate_path: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the path to the SSL certificate.

Source

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.

Source

pub fn address( self, address: &InstanceAddress, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the hostname, port and secure of the GraphQL server.

Source

pub fn shutdown_timeout<S: Into<OptionOption<u64>>>( self, shutdown_timeout: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets timeout of the shutdown of the GraphQL server.

Source

pub fn workers<S: Into<OptionOption<usize>>>( self, workers: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets the number of workers of the GraphQL server.

Source

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.

Source

pub fn disable_all_plugins<S: Into<OptionOption<bool>>>( self, disabled: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Disables all plugins.

Source

pub fn disabled_plugins<S: Into<OptionOption<Vec<String>>>>( self, disabled_plugins: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Sets which plugins will be disabled.

Source

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.

Source

pub fn disable_hot_deploy<S: Into<OptionOption<bool>>>( self, disabled: S, ) -> RuntimeBuilder<ConfigFilesLoaded, NotRunning>

Disables hot deployment of plugins.

Source

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.

Source

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.

Source

pub fn get(self) -> Arc<dyn Runtime>

Source

pub async fn init(self) -> RuntimeBuilder<ConfigFilesLoaded, Initialized>

Source

pub async fn block_on(self) -> RuntimeBuilder<ConfigFilesLoaded, Shutdown>

Source§

impl RuntimeBuilder<ConfigFilesLoaded, Initialized>

Source§

impl RuntimeBuilder<ConfigFilesLoaded, Ready>

Source

pub fn get(self) -> Arc<dyn Runtime>

Source

pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Ready>
where F: Future<Output = ()>, C: FnOnce(Arc<dyn Runtime>) -> F,

Source

pub async fn spawn(self) -> RuntimeBuilder<ConfigFilesLoaded, Running>

Starts the GraphQL server (non-blocking).

Source

pub async fn spawn_blocking(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>

Starts the GraphQL server (blocking).

Source

pub async fn run_for( self, duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>

Runs starts the GraphQL server. Stops the GraphQL server after the given duration.

Source

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>

Source

pub fn get(self) -> Arc<dyn Runtime + Send + Sync>

Source

pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Running>
where F: Future<Output = ()>, C: FnOnce(Arc<dyn Runtime + Send + Sync>) -> F,

Source

pub async fn stop(self) -> RuntimeBuilder<ConfigFilesLoaded, Finished>

Stops the runtime. Waits for the GraphQL server has been stopped.

Source

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.

Source

pub async fn wait_for_stopped( self, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>

Waits for the GraphQL server has been stopped.

Source

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>

Source

pub fn get(self) -> Arc<dyn Runtime>

Source

pub async fn with_runtime<F, C>( self, f: C, ) -> RuntimeBuilder<ConfigFilesLoaded, Finished>
where F: Future<Output = ()>, C: FnOnce(Arc<dyn Runtime>) -> F,

Source

pub async fn pre_shutdown( self, ) -> RuntimeBuilder<ConfigFilesLoaded, PreShutdown>

Source§

impl RuntimeBuilder<ConfigFilesLoaded, PreShutdown>

Source§

impl RuntimeBuilder<ConfigFilesLoaded, Shutdown>

Source

pub async fn wait_for( self, duration: Duration, ) -> RuntimeBuilder<ConfigFilesLoaded, Shutdown>

Trait Implementations§

Source§

impl Default for RuntimeBuilder<SetConfigLocations, NotRunning>

Source§

fn default() -> Self

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

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>
where L: Send, R: Send,

§

impl<L, R> Sync for RuntimeBuilder<L, R>
where L: Sync, R: Sync,

§

impl<L, R> Unpin for RuntimeBuilder<L, R>
where L: Unpin, R: Unpin,

§

impl<L, R> !UnwindSafe for RuntimeBuilder<L, R>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T