[−][src]Struct bracket::render::scope::Scope
A scope encapsulates a base value (lookup object) used when
resolving variable paths and a collection of local variables
which are prefixed using the @
symbol.
Helpers can create scopes and push and pop them from the scope stack to create new variable evaluation contexts.
Implementations
impl Scope
[src]
pub fn new() -> Self
[src]
Create a new scope.
pub fn locals(&self) -> &Value
[src]
Get the underlying locals value.
pub fn set_local(&mut self, name: &str, value: Value)
[src]
Set a named local variable.
The name does not need an @
prefix it is automatically
prepended to the key.
pub fn local(&self, name: &str) -> Option<&Value>
[src]
Get a named local.
Locals should have the @
prefix.
pub fn set_base_value(&mut self, value: Value)
[src]
Set the base value for the scope.
When the renderer resolves variables if they can be resolved using this value they are preferred over the root object.
pub fn base_value(&self) -> &Option<Value>
[src]
Get the base value for this scope.
Trait Implementations
impl Debug for Scope
[src]
impl From<Map<String, Value>> for Scope
[src]
Create a Scope from a locals map.
Auto Trait Implementations
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,