pub struct Template { /* private fields */ }Expand description
A struct representing a wrut template.
Implementations§
Source§impl Template
impl Template
Sourcepub fn from(path: impl Into<PathBuf>, name: Option<&str>) -> Result<Self>
pub fn from(path: impl Into<PathBuf>, name: Option<&str>) -> Result<Self>
Create a new Template struct given a path and an optional name.
§Arguments
path- The path to a directoryname- The name of the template- If
nameisNone, then the directory name of path provided will be used.
- If
Sourcepub fn get(name: &str) -> Result<Self>
pub fn get(name: &str) -> Result<Self>
Get an existing Template struct given its name.
If no such project exists, it will return an error.
Sourcepub fn list() -> Result<Vec<String>>
pub fn list() -> Result<Vec<String>>
Get a Vec<String> of containing a list of all currently registered projects.
Sourcepub fn init(self) -> Result<Self>
pub fn init(self) -> Result<Self>
Initialize a template.
This function will create a .wrut.toml file in the provided directory and register a symlink
to dir in ~/.wrut/templates.
Add tags to a template.
Auto Trait Implementations§
impl Freeze for Template
impl RefUnwindSafe for Template
impl Send for Template
impl Sync for Template
impl Unpin for Template
impl UnwindSafe for Template
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