Struct dotfiles_actions::link::directive::LinkDirective

source ·
pub struct LinkDirective<'a, F: FileSystem + UnixFileSystem + Default> { /* private fields */ }
Expand description

A directive that can build LinkActions to create directories in the filesystem.

Implementations§

source§

impl<'a, F: FileSystem + UnixFileSystem + Default> LinkDirective<'a, F>
where LinkDirective<'a, F>: HasDirectiveData<'a> + Directive<'a>,

source

pub fn fs(&self) -> &F

Returns the [FileSystem] instance being used.

source

pub fn parse_shortened_action( &'a self, context_settings: &Settings, yaml: &StrictYaml, current_dir: &Path ) -> Result<LinkAction<'a, F>, DotfilesError>

Parse a shortened action with only link name to target name

Trait Implementations§

source§

impl<'a, F: FileSystem + UnixFileSystem + Default> ActionParser<'a> for LinkDirective<'a, F>

§

type ActionType = LinkAction<'a, F>

The action type this object parses
source§

fn parse_action( &'a self, settings: &Settings, yaml: &StrictYaml, current_directory: &Path ) -> Result<LinkAction<'a, 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>

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 + UnixFileSystem + Default> Clone for LinkDirective<'a, F>

source§

fn clone(&self) -> LinkDirective<'a, F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, F: FileSystem + UnixFileSystem + Default> Default for LinkDirective<'a, F>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'a, F: FileSystem + UnixFileSystem + Default> Directive<'a> for LinkDirective<'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>

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>

Parses an individual setting named name from a yaml hash using the type stored in DirectiveData.setting_types.
source§

impl<'a, F: FileSystem + UnixFileSystem + Default> FileSystemDirective<'a, F> for LinkDirective<'a, F>

source§

fn fs(&self) -> &F

Returns the filesystem instance
source§

fn mut_fs(&mut self) -> &mut F

Returns a mutable reference to the filesystem instance
source§

impl<'a, F: FileSystem + UnixFileSystem + Default> HasDirectiveData<'a> for LinkDirective<'a, F>

source§

fn directive_data(&'a self) -> &'a DirectiveData

Returns the directive data for this object
§

fn name(&'a self) -> &'a str

Returns the name of the directive.
§

fn defaults(&'a self) -> &'a HashMap<String, Setting>

Returns the default settings as configured.

Auto Trait Implementations§

§

impl<'a, F> Freeze for LinkDirective<'a, F>
where F: Freeze,

§

impl<'a, F> RefUnwindSafe for LinkDirective<'a, F>
where F: RefUnwindSafe,

§

impl<'a, F> Send for LinkDirective<'a, F>
where F: Send + Sync,

§

impl<'a, F> Sync for LinkDirective<'a, F>
where F: Sync,

§

impl<'a, F> Unpin for LinkDirective<'a, F>
where F: Unpin,

§

impl<'a, F> UnwindSafe for LinkDirective<'a, F>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

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 more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V