pub trait Host {
// Required methods
fn save_language(&mut self, lang: Lang) -> Result<(), String>;
fn write_file(&mut self, path: &str, contents: &str) -> Result<(), String>;
fn write_secret(&mut self, path: &str, contents: &str) -> Result<(), String>;
fn save_profiles(&mut self, file: &ConfigFile) -> Result<(), String>;
fn check_profile(&mut self, profile: &Profile) -> CheckResult;
fn connect(&mut self, name: &str) -> Result<Connection, String>;
}Expand description
What the loop asks of the world besides the network.
Required Methods§
fn save_language(&mut self, lang: Lang) -> Result<(), String>
Sourcefn write_file(&mut self, path: &str, contents: &str) -> Result<(), String>
fn write_file(&mut self, path: &str, contents: &str) -> Result<(), String>
Writes a new file (never over an existing one).
Sourcefn write_secret(&mut self, path: &str, contents: &str) -> Result<(), String>
fn write_secret(&mut self, path: &str, contents: &str) -> Result<(), String>
Writes a new file that only its owner can read (a token secret); never over an existing one.
Sourcefn save_profiles(&mut self, file: &ConfigFile) -> Result<(), String>
fn save_profiles(&mut self, file: &ConfigFile) -> Result<(), String>
Writes the default profile and the profiles, keeping the rest of the file as it is on disk.
Sourcefn check_profile(&mut self, profile: &Profile) -> CheckResult
fn check_profile(&mut self, profile: &Profile) -> CheckResult
Tries the connection of a profile that may not be saved.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".