Skip to main content

Host

Trait Host 

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

Source

fn save_language(&mut self, lang: Lang) -> Result<(), String>

Source

fn write_file(&mut self, path: &str, contents: &str) -> Result<(), String>

Writes a new file (never over an existing one).

Source

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.

Source

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.

Source

fn check_profile(&mut self, profile: &Profile) -> CheckResult

Tries the connection of a profile that may not be saved.

Source

fn connect(&mut self, name: &str) -> Result<Connection, String>

What the calls of a profile of the file go through, and the address it ends up using.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§