Skip to main content

ModeInput

Trait ModeInput 

Source
pub trait ModeInput {
    // Required method
    fn env(&self, name: &str) -> Option<String>;

    // Provided methods
    fn per_user_default(&self) -> Result<Suite, SuiteError> { ... }
    fn protected_paths(&self, real: &Suite) -> Vec<PathBuf> { ... }
}
Expand description

Where decide reads from. The default implementation of the provided methods is the real operating system. A test supplies a fake, including one that panics on any read.

Required Methods§

Source

fn env(&self, name: &str) -> Option<String>

An environment variable. Called only by a build that compiled test-mode.

Provided Methods§

Source

fn per_user_default(&self) -> Result<Suite, SuiteError>

The real per-user suite root, from the account database.

Source

fn protected_paths(&self, real: &Suite) -> Vec<PathBuf>

Locations a test root may never overlap, given the real suite root (<base>/Orthic Labs/shared): the whole Orthic Labs folder and the user’s content folders under the home that <base> belongs to.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§