Platform

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;
}

Required Methods§

Source

fn println(&self, message: &str)

Source

fn print(&self, message: &str)

Source

fn write(&self, message: &str)

Source

fn read_line(&self) -> String

Source

fn rand(&self) -> f64

Source

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

Source

fn write_file(&self, path: &str, content: &str) -> Result<(), FileErrorKind>

Source

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

Source

fn list_files(&self, path: &str) -> Result<Vec<String>, FileErrorKind>

Source

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

Source

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

Source

fn list_dirs(&self, path: &str) -> Result<Vec<String>, FileErrorKind>

Source

fn current_dir(&self) -> Result<String, FileErrorKind>

Source

fn file_append(&self, path: &str, content: &str) -> Result<(), FileErrorKind>

Source

fn args(&self) -> Vec<String>

Source

fn exit(&self, code: i32)

Source

fn sleep(&self, seconds: f64)

Source

fn date_now(&self) -> i64

Source

fn timezone_offset(&self) -> i32

Implementors§