Struct dotfiles_actions::create::directive::CreateDirective
source · pub struct CreateDirective<'a, F: FileSystem + Default> { /* private fields */ }
Expand description
A directive that can build CreateActions to create directories in the filesystem.
Trait Implementations§
source§impl<'a, F: FileSystem + Default> ActionParser<'a> for CreateDirective<'a, F>
impl<'a, F: FileSystem + Default> ActionParser<'a> for CreateDirective<'a, F>
§type ActionType = CreateAction<'a, F>
type ActionType = CreateAction<'a, F>
The action type this object parses
source§fn parse_action(
&'a self,
settings: &HashMap<String, Setting>,
yaml: &StrictYaml,
current_dir: &Path
) -> Result<CreateAction<'_, F>, DotfilesError>
fn parse_action( &'a self, settings: &HashMap<String, Setting>, yaml: &StrictYaml, current_dir: &Path ) -> Result<CreateAction<'_, F>, DotfilesError>
Builds a single action of type [ActionParser::ActionType] from StrictYaml tree object
that represents the action’s configuration and a default settings object. Read more
§fn parse_action_list(
&'a self,
settings: &HashMap<String, Setting>,
yaml: &StrictYaml,
current_dir: &Path
) -> Result<Vec<Self::ActionType>, DotfilesError>
fn parse_action_list( &'a self, settings: &HashMap<String, Setting>, yaml: &StrictYaml, current_dir: &Path ) -> Result<Vec<Self::ActionType>, DotfilesError>
Builds a list of actions of type [ActionParser::ActionType] from StrictYaml tree object
that represents the actions’ configurations and a default settings object. Read more
source§impl<'a, F: Clone + FileSystem + Default> Clone for CreateDirective<'a, F>
impl<'a, F: Clone + FileSystem + Default> Clone for CreateDirective<'a, F>
source§fn clone(&self) -> CreateDirective<'a, F>
fn clone(&self) -> CreateDirective<'a, F>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<'a, F: FileSystem + Default> Default for CreateDirective<'a, F>
impl<'a, F: FileSystem + Default> Default for CreateDirective<'a, F>
source§impl<'a, F: FileSystem + Default> Directive<'a> for CreateDirective<'a, F>
impl<'a, F: FileSystem + Default> Directive<'a> for CreateDirective<'a, F>
§fn get_setting_from_yaml_hash_or_from_context(
&'a self,
name: &str,
yaml: &StrictYaml,
context_settings: &HashMap<String, Setting>
) -> Result<Setting, DotfilesError>
fn get_setting_from_yaml_hash_or_from_context( &'a self, name: &str, yaml: &StrictYaml, context_settings: &HashMap<String, Setting> ) -> Result<Setting, DotfilesError>
Parse a particular setting with its correct type from yaml, fall back to context settings or
directive defaults if not found in yaml. Returns error if there is any kind of parsing or
typing error
§fn get_setting_from_yaml_hash(
&'a self,
name: &str,
yaml: &StrictYaml
) -> Result<Setting, DotfilesError>
fn get_setting_from_yaml_hash( &'a self, name: &str, yaml: &StrictYaml ) -> Result<Setting, DotfilesError>
Parses an individual setting named
name
from a yaml hash using the type stored in
DirectiveData.setting_types
.source§impl<'a, F: FileSystem + Default> FileSystemDirective<'a, F> for CreateDirective<'a, F>
impl<'a, F: FileSystem + Default> FileSystemDirective<'a, F> for CreateDirective<'a, F>
source§impl<'a, F: FileSystem + Default> HasDirectiveData<'a> for CreateDirective<'a, F>
impl<'a, F: FileSystem + Default> HasDirectiveData<'a> for CreateDirective<'a, F>
Auto Trait Implementations§
impl<'a, F> Freeze for CreateDirective<'a, F>where
F: Freeze,
impl<'a, F> RefUnwindSafe for CreateDirective<'a, F>where
F: RefUnwindSafe,
impl<'a, F> Send for CreateDirective<'a, F>
impl<'a, F> Sync for CreateDirective<'a, F>where
F: Sync,
impl<'a, F> Unpin for CreateDirective<'a, F>where
F: Unpin,
impl<'a, F> UnwindSafe for CreateDirective<'a, F>where
F: UnwindSafe + RefUnwindSafe,
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