pub enum Var {
W = 0,
X = 1,
Y = 2,
Z = 3,
}
Expand description
A variable in DVI data.
DVI data has access to four variables.
These variables are set using the Op::SetVar
operation
and used in the Op::Move
operation.
These variables and associated operations exist to support
the following optimization.
It is possible to replace repeated
identical Op::Right
/Op::Down
operations with sets and moves
that serialize to a smaller number of bytes.
For example this DVI sequence:
vec![
dvi::Op::Down(300),
dvi::Op::Down(300),
dvi::Op::Down(300),
];
is identical to this DVI sequence:
vec![
// Set Y to 300 and move down by that value.
dvi::Op::SetVar(dvi::Var::Y, 300),
// Move down by the current value of Y, 300.
dvi::Op::Move(dvi::Var::Y),
dvi::Op::Move(dvi::Var::Y),
];
The first sequence serializes to 9 bytes, while the second serializes to 5 bytes. This optimization is performed in TeX.2021.595 and onwards.
Of the four variables, Var::W
and Var::X
operate on the
horizontal part of the cursor h, and Var::Y
and Var::Z
operate on the vertical part of the cursor v.
Variants§
Trait Implementations§
impl Copy for Var
impl Eq for Var
impl StructuralPartialEq for Var
Auto Trait Implementations§
impl Freeze for Var
impl RefUnwindSafe for Var
impl Send for Var
impl Sync for Var
impl Unpin for Var
impl UnwindSafe for Var
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
)