Struct ckb_resource::TemplateContext[][src]

pub struct TemplateContext<'a> { /* fields omitted */ }
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

Performs the conversion.

Performs the conversion.

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.