Trait IOContext

Source
pub trait IOContext {
    type Offchain: GetScriptsData + InitGovernance + GetDParam + UpsertDParam + Deregister + Register + GetPermissionedCandidates + UpsertPermissionedCandidates;

Show 19 methods // Required methods fn run_command(&self, cmd: &str) -> Result<String>; fn current_executable(&self) -> Result<String>; fn print(&self, msg: &str); fn eprint(&self, msg: &str); fn enewline(&self); fn prompt(&self, prompt: &str, default: Option<&str>) -> String; fn prompt_yes_no(&self, prompt: &str, default: bool) -> bool; fn prompt_multi_option(&self, msg: &str, options: Vec<String>) -> String; fn write_file(&self, path: &str, content: &str); fn new_tmp_file(&self, content: &str) -> TempPath; fn new_tmp_dir(&self) -> PathBuf; fn read_file(&self, path: &str) -> Option<String>; fn file_exists(&self, path: &str) -> bool; fn list_directory(&self, path: &str) -> Result<Option<Vec<String>>>; fn delete_file(&self, path: &str) -> Result<()>; fn set_env_var(&self, key: &str, value: &str); fn current_timestamp(&self) -> Timestamp; fn ogmios_rpc( &self, config: &ServiceConfig, req: OgmiosRequest, ) -> Result<OgmiosResponse>; fn offchain_impl( &self, ogmios_config: &ServiceConfig, ) -> Result<Self::Offchain>;
}

Required Associated Types§

Source

type Offchain: GetScriptsData + InitGovernance + GetDParam + UpsertDParam + Deregister + Register + GetPermissionedCandidates + UpsertPermissionedCandidates

It should implement all the required traits for offchain operations

Required Methods§

Source

fn run_command(&self, cmd: &str) -> Result<String>

Source

fn current_executable(&self) -> Result<String>

Source

fn print(&self, msg: &str)

Source

fn eprint(&self, msg: &str)

Source

fn enewline(&self)

Source

fn prompt(&self, prompt: &str, default: Option<&str>) -> String

Source

fn prompt_yes_no(&self, prompt: &str, default: bool) -> bool

Source

fn prompt_multi_option(&self, msg: &str, options: Vec<String>) -> String

Source

fn write_file(&self, path: &str, content: &str)

Source

fn new_tmp_file(&self, content: &str) -> TempPath

Source

fn new_tmp_dir(&self) -> PathBuf

Source

fn read_file(&self, path: &str) -> Option<String>

Source

fn file_exists(&self, path: &str) -> bool

Source

fn list_directory(&self, path: &str) -> Result<Option<Vec<String>>>

Source

fn delete_file(&self, path: &str) -> Result<()>

Source

fn set_env_var(&self, key: &str, value: &str)

Source

fn current_timestamp(&self) -> Timestamp

Source

fn ogmios_rpc( &self, config: &ServiceConfig, req: OgmiosRequest, ) -> Result<OgmiosResponse>

Source

fn offchain_impl(&self, ogmios_config: &ServiceConfig) -> Result<Self::Offchain>

Implementors§