pub struct BlockParams<'reg> { /* private fields */ }
Expand description
A map holds block parameters. The parameter can be either a value or a reference
Implementations§
Source§impl<'reg> BlockParams<'reg>
impl<'reg> BlockParams<'reg>
Sourcepub fn new() -> BlockParams<'reg>
pub fn new() -> BlockParams<'reg>
Create a empty block parameter map.
Sourcepub fn add_path(
&mut self,
k: &'reg str,
path: Vec<String>,
) -> Result<(), RenderError>
pub fn add_path( &mut self, k: &'reg str, path: Vec<String>, ) -> Result<(), RenderError>
Add a path reference as the parameter. The path
is a vector of path
segments the relative to current block’s base path.
Sourcepub fn add_value(&mut self, k: &'reg str, v: Json) -> Result<(), RenderError>
pub fn add_value(&mut self, k: &'reg str, v: Json) -> Result<(), RenderError>
Add a value as parameter.
Sourcepub fn get(&self, k: &str) -> Option<&BlockParamHolder>
pub fn get(&self, k: &str) -> Option<&BlockParamHolder>
Get a block parameter by its name.
Trait Implementations§
Source§impl<'reg> Clone for BlockParams<'reg>
impl<'reg> Clone for BlockParams<'reg>
Source§fn clone(&self) -> BlockParams<'reg>
fn clone(&self) -> BlockParams<'reg>
Returns a copy 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<'reg> Debug for BlockParams<'reg>
impl<'reg> Debug for BlockParams<'reg>
Source§impl<'reg> Default for BlockParams<'reg>
impl<'reg> Default for BlockParams<'reg>
Source§fn default() -> BlockParams<'reg>
fn default() -> BlockParams<'reg>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'reg> Freeze for BlockParams<'reg>
impl<'reg> RefUnwindSafe for BlockParams<'reg>
impl<'reg> Send for BlockParams<'reg>
impl<'reg> Sync for BlockParams<'reg>
impl<'reg> Unpin for BlockParams<'reg>
impl<'reg> UnwindSafe for BlockParams<'reg>
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