pub struct TemplateContext {Show 13 fields
pub plugin_name: String,
pub plugin_description: String,
pub author: String,
pub org: String,
pub plugin_type: String,
pub has_wasm: bool,
pub has_docker: bool,
pub has_mock: bool,
pub plugin_id: String,
pub crate_name: String,
pub current_year: String,
pub today: String,
pub pascal_case_name: String,
}Expand description
Template rendering context with user config + computed fields
Fields§
§plugin_name: String§plugin_description: String§org: String§plugin_type: String§has_wasm: bool§has_docker: bool§has_mock: bool§plugin_id: String§crate_name: String§current_year: String§today: String§pascal_case_name: StringImplementations§
Source§impl TemplateContext
impl TemplateContext
Sourcepub fn from_config(config: &ProjectConfig) -> Self
pub fn from_config(config: &ProjectConfig) -> Self
Build context from project config with computed fields
Sourcepub fn apply_dates_from_existing_plugin_json(&mut self, project_dir: &Path)
pub fn apply_dates_from_existing_plugin_json(&mut self, project_dir: &Path)
Prefer plugin.json info.updated and derived year so updates do not churn dates.
Trait Implementations§
Source§impl Debug for TemplateContext
impl Debug for TemplateContext
Auto Trait Implementations§
impl Freeze for TemplateContext
impl RefUnwindSafe for TemplateContext
impl Send for TemplateContext
impl Sync for TemplateContext
impl Unpin for TemplateContext
impl UnsafeUnpin for TemplateContext
impl UnwindSafe for TemplateContext
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