Struct ckb_resource::TemplateContext
source · 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) -> Selfwhere
I: IntoIterator<Item = (&'a str, &'a str)>,
pub fn new<I>(spec: &'a str, kvs: I) -> Selfwhere I: IntoIterator<Item = (&'a str, &'a str)>,
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> 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