Struct punktf_lib::visit::deploy::Deployer
source · pub struct Deployer<F> { /* private fields */ }Expand description
Responsible for deploying a profile.
This includes checking for merge conflicts, resolving children of a directory dotfile, parsing and resolving of templates and the actual writing of the dotfile to the target destination.
Implementations§
source§impl<F> Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
impl<F> Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
sourcepub fn new(options: DeployOptions, merge_ask_fn: F) -> Self
pub fn new(options: DeployOptions, merge_ask_fn: F) -> Self
Creates a new instance.
sourcepub fn into_deployment(self) -> Deployment
pub fn into_deployment(self) -> Deployment
Retrieves the finished deployment from this instance.
sourcepub fn deploy(
self,
source: &PunktfSource,
profile: &mut LayeredProfile
) -> Deployment
pub fn deploy(
self,
source: &PunktfSource,
profile: &mut LayeredProfile
) -> Deployment
Tries to deploy the given profile.
Errors
Only hard errors will be returned as error, everthing else will be recorded in the Deployment on a dotfile level.
Trait Implementations§
source§impl<F: PartialEq> PartialEq<Deployer<F>> for Deployer<F>
impl<F: PartialEq> PartialEq<Deployer<F>> for Deployer<F>
source§impl<F> TemplateVisitor for Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
impl<F> TemplateVisitor for Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
source§fn accept_template<'a>(
&mut self,
_: &PunktfSource,
profile: &LayeredProfile,
file: &File<'a>,
resolve_content: impl FnOnce(&str) -> Result<String>
) -> Result
fn accept_template<'a>(
&mut self,
_: &PunktfSource,
profile: &LayeredProfile,
file: &File<'a>,
resolve_content: impl FnOnce(&str) -> Result<String>
) -> Result
Accepts a file template item and tries to deploy it.
Before the deployment the template is parsed and resolved.
source§impl<F> Visitor for Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
impl<F> Visitor for Deployer<F>where
F: Fn(&Path, &Path) -> Result<bool>,
source§fn accept_file<'a>(
&mut self,
_: &PunktfSource,
profile: &LayeredProfile,
file: &File<'a>
) -> Result
fn accept_file<'a>(
&mut self,
_: &PunktfSource,
profile: &LayeredProfile,
file: &File<'a>
) -> Result
Accepts a file item and tries to deploy it.
source§fn accept_directory<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
directory: &Directory<'a>
) -> Result
fn accept_directory<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
directory: &Directory<'a>
) -> Result
Accepts a directory item and tries to deploy it.
source§fn accept_link(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
link: &Symlink
) -> Result
fn accept_link(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
link: &Symlink
) -> Result
Accepts a link item and tries to deploy it.
source§fn accept_rejected<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
rejected: &Rejected<'a>
) -> Result
fn accept_rejected<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
rejected: &Rejected<'a>
) -> Result
Accepts a rejected item and reports it.
source§fn accept_errored<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
errored: &Errored<'a>
) -> Result
fn accept_errored<'a>(
&mut self,
_: &PunktfSource,
_: &LayeredProfile,
errored: &Errored<'a>
) -> Result
Accepts a errored item and reports it.
impl<F: Eq> Eq for Deployer<F>
impl<F> StructuralEq for Deployer<F>
impl<F> StructuralPartialEq for Deployer<F>
Auto Trait Implementations§
impl<F> RefUnwindSafe for Deployer<F>where
F: RefUnwindSafe,
impl<F> Send for Deployer<F>where
F: Send,
impl<F> Sync for Deployer<F>where
F: Sync,
impl<F> Unpin for Deployer<F>where
F: Unpin,
impl<F> UnwindSafe for Deployer<F>where
F: UnwindSafe,
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<D> OwoColorize for D
impl<D> OwoColorize for D
§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
§fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>
§fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>
§fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>
§fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>
§fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>
§fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
§fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
§fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
§fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
§fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
§fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
§fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
§fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
§fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
§fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
§fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
§fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
§fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
§fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
§fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
§fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
§fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast<'a>(&'a self) -> BlinkFastDisplay<'a, Self>
§fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>
§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read more§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more