Struct SimpleContext
struct SimpleContext { ... }
Simple template expansion context.
Implementations
impl SimpleContext
fn new() -> SelfCreates a new empty context.
Examples
# use Error; # # Ok::fn insert<K, V>(self: &mut Self, key: K, value: V) -> Option<Value> where K: Into<String>, V: Into<Value>Inserts a variable.
Passing
Value::Undefinedremoves the value from the context.The entry will be inserted or removed even if the key is invalid as a variable name. Such entries will be simply ignored on expansion.
Examples
# use Error; # # Ok::Passing
Value::Undefinedremoves the value from the context.# use Error; ## # Ok::fn clear(self: &mut Self)Removes all entries in the context.
Examples
# use Error; # # Ok::fn get(self: &Self, key: VarName<'_>) -> Option<&Value>Returns a reference to the value for the key.
impl Clone for SimpleContext
fn clone(self: &Self) -> SimpleContext
impl Context for SimpleContext
fn visit<V: Visitor>(self: &Self, visitor: V) -> <V as >::Result
impl Debug for SimpleContext
fn fmt(self: &Self, f: &mut Formatter<'_>) -> Result
impl Default for SimpleContext
fn default() -> SimpleContext
impl Freeze for SimpleContext
impl RefUnwindSafe for SimpleContext
impl Send for SimpleContext
impl Sync for SimpleContext
impl Unpin for SimpleContext
impl UnsafeUnpin for SimpleContext
impl UnwindSafe for SimpleContext
impl<C> DynamicContext for SimpleContext
fn visit_dynamic<V>(self: &mut Self, visitor: V) -> <V as Visitor>::Result where V: Visitor
impl<T> Any for SimpleContext
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for SimpleContext
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for SimpleContext
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for SimpleContext
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for SimpleContext
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for SimpleContext
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for SimpleContext
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for SimpleContext
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for SimpleContext
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>