Struct ya_runtime_sdk::Context [−][src]
pub struct Context<R: Runtime + ?Sized> { pub cli: <R as RuntimeDef>::Cli, pub conf: <R as RuntimeDef>::Conf, pub conf_path: PathBuf, pub emitter: Option<EventEmitter>, // some fields omitted }
Expand description
Runtime execution context
Fields
cli: <R as RuntimeDef>::CliCommand line parameters
conf: <R as RuntimeDef>::ConfConfiguration read from the configuration file
conf_path: PathBufConfiguration file path
emitter: Option<EventEmitter>Event emitter, available when
Runtime::MODE == RuntimeMode::Server
and
command != Command::Deploy
Implementations
Create a new instance with provided environment configuration
Read configuration from file
Write configuration to file
pub fn command<'a, H, Fh>(&mut self, handler: H) -> ProcessIdResponse<'a> where
H: FnOnce(RunCommandContext) -> Fh + 'static,
Fh: Future<Output = Result<(), Error>> + 'a, [src]Auto Trait Implementations
impl<R> !RefUnwindSafe for Context<R>impl<R> Send for Context<R> where
<R as RuntimeDef>::Cli: Send,
<R as RuntimeDef>::Conf: Send, impl<R> Sync for Context<R> where
<R as RuntimeDef>::Cli: Sync,
<R as RuntimeDef>::Conf: Sync, impl<R> Unpin for Context<R> where
<R as RuntimeDef>::Cli: Unpin,
<R as RuntimeDef>::Conf: Unpin, impl<R> !UnwindSafe for Context<R>