pub struct Config(pub HaxeVersion);Expand description
A basic representation of a libmask configuration.
Tuple Fields§
§0: HaxeVersionImplementations§
Source§impl Config
impl Config
Sourcepub fn new(path: Option<&str>) -> Result<Config, Error>
pub fn new(path: Option<&str>) -> Result<Config, Error>
This reads a sample configuration from the disk, and returns it if it’s valid as a Result.
Sourcepub fn path(config_location: &str) -> Result<&Path, Error>
pub fn path(config_location: &str) -> Result<&Path, Error>
Checks a configuration path’s validity and whether or not it exists, returning the path if it exists.
Configuration paths are typically encased in Options to simulate
default parameters, where leaving None as the value results in the
fallback path, .mask, being used. This method will instead return the
raw path through a Result, as this method internally uses
Path.try_exists.
Sourcepub fn read_from_file(supposed_path: &str) -> Result<String, Error>
pub fn read_from_file(supposed_path: &str) -> Result<String, Error>
Reads a file from a disk, returning its contents according to read_to_string.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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