pub struct TemplateContext<'a> { /* private fields */ }
Expand description

The context used to expand the Template.

Implementations§

Creates a new template.

  • spec - the chain spec name for template spec branch.
  • kvs - the initial template variables.
Examples
use ckb_resource::TemplateContext;
// Creates a context for *dev* chain and initializes variables:
//
//     rpc_port      => 8114
//     p2p_port      => 8115
TemplateContext::new("dev", vec![("rpc_port", "8114"), ("p2p_port", "8115")]);

Inserts a new variable into the context.

  • key - the variable name
  • value - the variable value

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.