TemplateManager

Struct TemplateManager 

Source
pub struct TemplateManager {
    pub config: Config,
    /* private fields */
}

Fields§

§config: Config

Implementations§

Source§

impl TemplateManager

Source

pub fn new() -> Result<Self>

Source

pub fn save_config(&self) -> Result<()>

Source

pub fn get_template_by_id(&self, id: &str) -> Option<&Template>

Source

pub fn get_repo_by_name(&self, name: &str) -> Option<&Repo>

Source

pub async fn download_template( &self, template: &Template, force: bool, ) -> Result<()>

Source

pub async fn download_all_templates(&self, force: bool) -> Result<()>

Source

pub fn list_templates(&self, verbose: bool)

Source

pub fn add_template( &mut self, id: String, name: String, repo: String, path: String, description: String, language: String, tags: Option<String>, ) -> Result<()>

Source

pub fn remove_template(&mut self, id: &str) -> Result<()>

Source

pub fn add_repo( &mut self, name: String, url: String, branch: String, ) -> Result<()>

Source

pub fn remove_repo(&mut self, name: &str) -> Result<()>

Source

pub fn copy_template_files( &self, template: &Template, project_path: &Path, ) -> Result<()>

Source

pub fn list_repos(&self)

Source

pub fn export_config(&self, output: &str, include_cache: bool) -> Result<()>

Source

pub fn import_config( &mut self, file: &str, mode: &str, skip_validation: bool, ) -> Result<()>

Source

pub fn validate_config_file(&self, file: &str) -> Result<()>

Source

pub fn clean_templates(&mut self, all: bool, force: bool) -> Result<()>

Source

pub fn show_info(&self, json: bool) -> Result<()>

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.