Struct texlang::variable::TypedVariable
source · pub struct TypedVariable<S, T>(/* private fields */);
Expand description
A TeX variable of a specific Rust type T
.
Implementations§
source§impl<S, T> TypedVariable<S, T>
impl<S, T> TypedVariable<S, T>
source§impl<S, T> TypedVariable<S, T>where
S: TexlangState,
T: SupportedType,
impl<S, T> TypedVariable<S, T>where S: TexlangState, T: SupportedType,
sourcepub fn set(&self, input: &mut ExecutionInput<S>, scope: Scope, value: T)
pub fn set(&self, input: &mut ExecutionInput<S>, scope: Scope, value: T)
Sets the value of the variable.
The input and scope must be passed because of TeX’s grouping semantics. When the current group ends, any variable assignments made in the group are rolled back. Thus this function generally saves the current value of the variable in the VM so that it can be restored later. This is why the full input must be provided, and not just the state.
Trait Implementations§
source§impl<S, T> Clone for TypedVariable<S, T>
impl<S, T> Clone for TypedVariable<S, T>
source§impl<S, T> Hash for TypedVariable<S, T>
impl<S, T> Hash for TypedVariable<S, T>
source§impl<S, T> PartialEq<TypedVariable<S, T>> for TypedVariable<S, T>
impl<S, T> PartialEq<TypedVariable<S, T>> for TypedVariable<S, T>
source§fn eq(&self, rhs: &TypedVariable<S, T>) -> bool
fn eq(&self, rhs: &TypedVariable<S, T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<S, T> Copy for TypedVariable<S, T>
impl<S, T> Eq for TypedVariable<S, T>
Auto Trait Implementations§
impl<S, T> RefUnwindSafe for TypedVariable<S, T>
impl<S, T> Send for TypedVariable<S, T>
impl<S, T> Sync for TypedVariable<S, T>
impl<S, T> Unpin for TypedVariable<S, T>
impl<S, T> UnwindSafe for TypedVariable<S, T>
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