pub struct TemplateContext {
pub payload: Value,
pub state: Value,
pub config: Value,
pub answers: Value,
pub secrets: Option<SecretsContext>,
}Expand description
Context passed into templates.
Fields§
§payload: Value§state: Value§config: Value§answers: Value§secrets: Option<SecretsContext>Implementations§
Source§impl TemplateContext
impl TemplateContext
Sourcepub fn with_payload(self, payload: Value) -> Self
pub fn with_payload(self, payload: Value) -> Self
Replace the payload value.
Sourcepub fn with_state(self, state: Value) -> Self
pub fn with_state(self, state: Value) -> Self
Replace the state value.
Sourcepub fn with_config(self, config: Value) -> Self
pub fn with_config(self, config: Value) -> Self
Replace the config value.
Sourcepub fn with_answers(self, answers: Value) -> Self
pub fn with_answers(self, answers: Value) -> Self
Replace answers.
Sourcepub fn with_secrets(
self,
secrets: Value,
policy: Option<SecretsPolicy>,
host_available: bool,
) -> Self
pub fn with_secrets( self, secrets: Value, policy: Option<SecretsPolicy>, host_available: bool, ) -> Self
Set optional secrets with policy metadata.
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
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