Struct ya_runtime_sdk::Context

source ·
pub struct Context<R: Runtime + ?Sized> {
    pub cli: <R as RuntimeDef>::Cli,
    pub conf: <R as RuntimeDef>::Conf,
    pub conf_path: PathBuf,
    pub env: Box<dyn Env<<R as RuntimeDef>::Cli>>,
    pub emitter: Option<EventEmitter>,
    /* private fields */
}
Expand description

Runtime execution context

Fields§

§cli: <R as RuntimeDef>::Cli

Command line parameters

§conf: <R as RuntimeDef>::Conf

Configuration read from the configuration file

§conf_path: PathBuf

Configuration file path

§env: Box<dyn Env<<R as RuntimeDef>::Cli>>

Environment instance

§emitter: Option<EventEmitter>

Event emitter, available when Runtime::MODE == RuntimeMode::Server and command != Command::Deploy

Implementations§

Create a new instance with a default environment configuration

Create a new instance with provided environment configuration

Read configuration from file

Write configuration to file

Return a runtime control object

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more