pub struct RegTape { /* private fields */ }Expand description
Low-level tape for use with the Fidget virtual machine (or to be lowered further into machine instructions).
Implementations§
Source§impl RegTape
impl RegTape
Sourcepub fn new<const N: usize>(ssa: &SsaTape) -> Self
pub fn new<const N: usize>(ssa: &SsaTape) -> Self
Lowers the tape to assembly with a particular register limit
Note that if you also want to simplify the tape, it’s more efficient
to use VmData::simplify, which
simultaneously simplifies and performs register allocation in a
single pass.
Sourcepub fn slot_count(&self) -> usize
pub fn slot_count(&self) -> usize
Returns the number of unique register and memory locations that are used by this tape.
Sourcepub fn iter(&self) -> impl DoubleEndedIterator<Item = &RegOp>
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &RegOp>
Returns a front-to-back iterator
This is the opposite of evaluation order; it will visit the root of the tree first, and end at the leaves.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RegTape
impl<'de> Deserialize<'de> for RegTape
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> IntoIterator for &'a RegTape
impl<'a> IntoIterator for &'a RegTape
Auto Trait Implementations§
impl Freeze for RegTape
impl RefUnwindSafe for RegTape
impl Send for RegTape
impl Sync for RegTape
impl Unpin for RegTape
impl UnsafeUnpin for RegTape
impl UnwindSafe for RegTape
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.