pub struct OS { /* private fields */ }
Expand description
OS: Struct to run OS commands in a specific directory.
homedir: The directory as root directory. Example: you run mkdir(“hi”), that would create a directory called hi in the root directory.
Implementations§
Source§impl OS
impl OS
Sourcepub fn new(homedir: String) -> OS
pub fn new(homedir: String) -> OS
new: Creates a new OS struct.
homedir: The directory as root directory. Example: you run mkdir(“hi”), that would create a directory called hi in the root directory.
Sourcepub fn mkdir(&self, name: &str)
pub fn mkdir(&self, name: &str)
mkdir: Creates a new directory the ‘homedir’ property.
name: the name of the directory.
Sourcepub fn touch(&self, name: &str)
pub fn touch(&self, name: &str)
touch: Creates a new file the ‘homedir’ property.
name: the name of the file.
Sourcepub fn change_dir(&mut self, dir: String)
pub fn change_dir(&mut self, dir: String)
change_dir: Changes the root directory to the specified directory
dir: Where the directory is located
Auto Trait Implementations§
impl Freeze for OS
impl RefUnwindSafe for OS
impl Send for OS
impl Sync for OS
impl Unpin for OS
impl UnwindSafe for OS
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more