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 for TypedVariable<S, T>
impl<S, T> PartialEq for TypedVariable<S, T>
impl<S, T> Copy for TypedVariable<S, T>
impl<S, T> Eq for TypedVariable<S, T>
Auto Trait Implementations§
impl<S, T> Freeze for TypedVariable<S, T>
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)