Trait guidon::TryNew[][src]

pub trait TryNew<A> {
    fn try_new(src: A) -> Result<Self>
    where
        Self: Sized
; }

Try to initialize Guidon from different sources

Required methods

fn try_new(src: A) -> Result<Self> where
    Self: Sized
[src]

Try to initialize from an object A

Loading content...

Implementors

impl<'a> TryNew<CustomTemplate<'a>> for Guidon<'a>[src]

fn try_new(src: CustomTemplate<'a>) -> Result<Self>[src]

Initialization from a directory and a custom template file

Arguments

  • dir_path: the base directory of templatized files
  • template_path: the path of the template file to apply. Must respect template.toml syntax

impl<'a> TryNew<GitOptions> for Guidon<'a>[src]

fn try_new(git: GitOptions) -> Result<Self>[src]

Initialization from a git repository The repo MUST contains at its root a template.toml file.

impl<'a, P: 'a + AsRef<Path>> TryNew<P> for Guidon<'a>[src]

fn try_new(path: P) -> Result<Self>[src]

Initialization from a folder path or a file path

  • dir_path: the base directory for guidon-cli template. The file template.toml is searched in this directory, and templates files in template dir.
  • file_path: the path of the template file. The working dir is the current dir.
Loading content...