Struct dotfiles_processor::context::Context
source · pub struct Context { /* private fields */ }
Expand description
A context represents an environment in which defaults can be overriden, it can be thought of as the context of an individual configuration file to apply.
Notice that contexts can be built on top of one another, so that defaults can be overriden multiple times, and thus have some sort of configuration inheritance.
Implementations§
source§impl Context
impl Context
source§impl Context
impl Context
pub fn subcontext(&self, file: &Path) -> Result<Context, DotfilesError>
pub fn get_default(&self, dir: &str, setting: &str) -> Option<&Setting>
pub fn parse_file(&mut self) -> Result<(), DotfilesError>
sourcepub fn run_actions(context: Context) -> Result<(), DotfilesError>
pub fn run_actions(context: Context) -> Result<(), DotfilesError>
Runs the actions in this context and consumes the context.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more