pub struct TemplateContext<'a> { /* private fields */ }
Expand description
The context used to expand the Template
.
Implementations§
Source§impl<'a> TemplateContext<'a>
impl<'a> TemplateContext<'a>
Sourcepub fn new<I>(spec: &'a str, kvs: I) -> Self
pub fn new<I>(spec: &'a str, kvs: I) -> Self
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")]);
Auto Trait Implementations§
impl<'a> Freeze for TemplateContext<'a>
impl<'a> RefUnwindSafe for TemplateContext<'a>
impl<'a> Send for TemplateContext<'a>
impl<'a> Sync for TemplateContext<'a>
impl<'a> Unpin for TemplateContext<'a>
impl<'a> UnwindSafe for TemplateContext<'a>
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