pub struct TemplateContext {
pub values: Value,
pub release: ReleaseInfo,
pub pack: PackInfo,
pub capabilities: Capabilities,
pub template: TemplateInfo,
}Expand description
Context available to all templates
Fields§
§values: ValueUser values (merged)
release: ReleaseInfoRelease information
pack: PackInfoPack metadata
capabilities: CapabilitiesCluster capabilities
template: TemplateInfoCurrent template info
Implementations§
Source§impl TemplateContext
impl TemplateContext
Sourcepub fn new(values: Values, release: ReleaseInfo, pack: &PackMetadata) -> Self
pub fn new(values: Values, release: ReleaseInfo, pack: &PackMetadata) -> Self
Create a new template context
Sourcepub fn with_template(self, name: &str, base_path: &str) -> Self
pub fn with_template(self, name: &str, base_path: &str) -> Self
Set the current template info
Sourcepub fn with_capabilities(self, capabilities: Capabilities) -> Self
pub fn with_capabilities(self, capabilities: Capabilities) -> Self
Set capabilities
Trait Implementations§
Source§impl Clone for TemplateContext
impl Clone for TemplateContext
Source§fn clone(&self) -> TemplateContext
fn clone(&self) -> TemplateContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TemplateContext
impl Debug for TemplateContext
Source§impl<'de> Deserialize<'de> for TemplateContext
impl<'de> Deserialize<'de> for TemplateContext
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TemplateContext
impl RefUnwindSafe for TemplateContext
impl Send for TemplateContext
impl Sync for TemplateContext
impl Unpin 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