pub struct Fake {
pub files: HashMap<PathBuf, String>,
pub folders: HashMap<PathBuf, Vec<String>>,
pub links: HashMap<PathBuf, PathBuf>,
pub commands: HashMap<String, (bool, String)>,
pub dns: Option<Result<Vec<String>, String>>,
pub spaces: HashMap<PathBuf, (u64, u64)>,
pub owners: HashMap<PathBuf, u32>,
pub canonical: HashMap<PathBuf, PathBuf>,
pub tools: Vec<String>,
pub running: Vec<String>,
pub home: PathBuf,
}Expand description
A made-up machine, for tests.
Fields§
§files: HashMap<PathBuf, String>§folders: HashMap<PathBuf, Vec<String>>§links: HashMap<PathBuf, PathBuf>§commands: HashMap<String, (bool, String)>§dns: Option<Result<Vec<String>, String>>§spaces: HashMap<PathBuf, (u64, u64)>§owners: HashMap<PathBuf, u32>§canonical: HashMap<PathBuf, PathBuf>Where a path really is, when a link on the way leads elsewhere.
tools: Vec<String>§running: Vec<String>§home: PathBufTrait Implementations§
Source§impl System for Fake
impl System for Fake
fn read(&self, path: &Path) -> Option<String>
fn exists(&self, path: &Path) -> bool
fn list(&self, path: &Path) -> Vec<String>
fn link(&self, path: &Path) -> Option<PathBuf>
Source§fn run(&self, command: &[&str]) -> Option<(bool, String)>
fn run(&self, command: &[&str]) -> Option<(bool, String)>
A command’s success and standard output; None when it cannot run.
Source§fn resolve(&self, _: &str) -> Result<Vec<String>, String>
fn resolve(&self, _: &str) -> Result<Vec<String>, String>
The addresses a host name resolves to, within a few seconds.
Source§fn space(&self, path: &Path) -> Option<(u64, u64)>
fn space(&self, path: &Path) -> Option<(u64, u64)>
Free and total bytes of the file system holding a path.
fn user(&self) -> (u32, u32, PathBuf)
fn on_path(&self, tool: &str) -> bool
Auto Trait Implementations§
impl Freeze for Fake
impl RefUnwindSafe for Fake
impl Send for Fake
impl Sync for Fake
impl Unpin for Fake
impl UnsafeUnpin for Fake
impl UnwindSafe for Fake
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.