Skip to main content

RunnerOptions

Struct RunnerOptions 

Source
pub struct RunnerOptions<AppEv, L = ProcLockBackend, R = SystemRuntimeEnvironment> {
    pub boot_dir: Option<PathBuf>,
    pub restart: RestartPolicyOptions,
    pub signal_mapper: SignalMapper<AppEv>,
    pub lock_backend: L,
    pub runtime_environment: R,
}
Expand description

Options used by the async runner.

This is the preferred extension point for app-typed runtime policies such as signal mapping and for runner infrastructure choices such as lock backend, restart behavior, boot-state location, and telemetry provider.

Fields§

§boot_dir: Option<PathBuf>

Optional boot-state directory. Defaults to WORA’s host temp boot root.

§restart: RestartPolicyOptions

Restart and supervision behavior.

§signal_mapper: SignalMapper<AppEv>

Translate platform signals into application/runtime events.

The default mapper turns SIGHUP into ControlEvent::ReloadConfiguration, SIGUSR1 into ControlEvent::LogRotation, and termination signals into shutdown. The runner supervises shutdown; reload/log-rotation controls are delivered to the application.

§lock_backend: L

Lock backend used to serialize workload execution.

§runtime_environment: R

Runtime environment provider used for host and process telemetry.

Implementations§

Source§

impl<AppEv: Send + Sync + 'static> RunnerOptions<AppEv>

Source

pub fn new() -> Self

Create default runner options.

Source§

impl<AppEv: Send + Sync + 'static, L, R> RunnerOptions<AppEv, L, R>

Source

pub fn with_boot_dir(self, boot_dir: impl Into<PathBuf>) -> Self

Set the boot-state directory.

Source

pub fn with_restart_options(self, restart: RestartPolicyOptions) -> Self

Set restart and supervision behavior.

Source

pub fn with_signal_mapper( self, mapper: impl Fn(RuntimeSignal) -> Option<Event<AppEv>> + Send + Sync + 'static, ) -> Self

Set a custom platform signal mapper.

Source

pub fn with_lock_backend<NewL>( self, lock_backend: NewL, ) -> RunnerOptions<AppEv, NewL, R>

Set the lock backend used to serialize workload execution.

Source

pub fn with_runtime_environment<NewR>( self, runtime_environment: NewR, ) -> RunnerOptions<AppEv, L, NewR>

Set the runtime environment provider used for telemetry.

Trait Implementations§

Source§

impl<AppEv: Clone, L: Clone, R: Clone> Clone for RunnerOptions<AppEv, L, R>

Source§

fn clone(&self) -> RunnerOptions<AppEv, L, R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<AppEv: Send + Sync + 'static> Default for RunnerOptions<AppEv>

Source§

fn default() -> Self

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

Auto Trait Implementations§

§

impl<AppEv, L = ProcLockBackend, R = SystemRuntimeEnvironment> !RefUnwindSafe for RunnerOptions<AppEv, L, R>

§

impl<AppEv, L = ProcLockBackend, R = SystemRuntimeEnvironment> !UnwindSafe for RunnerOptions<AppEv, L, R>

§

impl<AppEv, L, R> Freeze for RunnerOptions<AppEv, L, R>
where Arc<dyn Fn(RuntimeSignal) -> Option<Event<AppEv>> + Sync + Send>: Freeze, L: Freeze, R: Freeze,

§

impl<AppEv, L, R> Send for RunnerOptions<AppEv, L, R>
where Arc<dyn Fn(RuntimeSignal) -> Option<Event<AppEv>> + Sync + Send>: Send, L: Send, R: Send,

§

impl<AppEv, L, R> Sync for RunnerOptions<AppEv, L, R>
where Arc<dyn Fn(RuntimeSignal) -> Option<Event<AppEv>> + Sync + Send>: Sync, L: Sync, R: Sync,

§

impl<AppEv, L, R> Unpin for RunnerOptions<AppEv, L, R>
where Arc<dyn Fn(RuntimeSignal) -> Option<Event<AppEv>> + Sync + Send>: Unpin, L: Unpin, R: Unpin,

§

impl<AppEv, L, R> UnsafeUnpin for RunnerOptions<AppEv, 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

Source§

type Error = !

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.
Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

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