Trait Platform
Source pub trait Platform: Debug {
Show 19 methods
// Required methods
fn println(&self, message: &str);
fn print(&self, message: &str);
fn write(&self, message: &str);
fn read_line(&self) -> String;
fn rand(&self) -> f64;
fn read_file(&self, path: &str) -> Result<String, FileErrorKind>;
fn write_file(&self, path: &str, content: &str) -> Result<(), FileErrorKind>;
fn remove_file(&self, path: &str) -> Result<(), FileErrorKind>;
fn list_files(&self, path: &str) -> Result<Vec<String>, FileErrorKind>;
fn create_dir(&self, path: &str) -> Result<(), FileErrorKind>;
fn remove_dir(&self, path: &str) -> Result<(), FileErrorKind>;
fn list_dirs(&self, path: &str) -> Result<Vec<String>, FileErrorKind>;
fn current_dir(&self) -> Result<String, FileErrorKind>;
fn file_append(
&self,
path: &str,
content: &str,
) -> Result<(), FileErrorKind>;
fn args(&self) -> Vec<String>;
fn exit(&self, code: i32);
fn sleep(&self, seconds: f64);
fn date_now(&self) -> i64;
fn timezone_offset(&self) -> i32;
}