pub enum DataType {
Bool,
U32,
U64,
U128,
Bfe,
Xfe,
Digest,
List(Box<DataType>),
Array(Box<ArrayType>),
Tuple(Vec<DataType>),
VoidPointer,
StructRef(StructType),
}
Variants§
Bool
U32
U64
U128
Bfe
Xfe
Digest
List(Box<DataType>)
Array(Box<ArrayType>)
Tuple(Vec<DataType>)
VoidPointer
StructRef(StructType)
Implementations§
Source§impl DataType
impl DataType
Sourcepub fn label_friendly_name(&self) -> String
pub fn label_friendly_name(&self) -> String
Return a string which can be used as part of function labels in Triton-VM
Sourcepub fn stack_size(&self) -> usize
pub fn stack_size(&self) -> usize
Return the size that the data type takes up on stack
Sourcepub fn read_value_from_memory_leave_pointer(&self) -> Vec<LabelledInstruction>
pub fn read_value_from_memory_leave_pointer(&self) -> Vec<LabelledInstruction>
Return the code to read a value of this type from memory. Leaves mutated point on top of stack.
BEFORE: _ (*address + self.stack_size() - 1)
AFTER: _ [value] (*address - 1)
Sourcepub fn read_value_from_memory_pop_pointer(&self) -> Vec<LabelledInstruction>
pub fn read_value_from_memory_pop_pointer(&self) -> Vec<LabelledInstruction>
Return the code to read a value of this type from memory. Pops pointer from stack.
BEFORE: _ (*address + self.stack_size() - 1)
AFTER: _ [value]
Sourcepub fn write_value_to_memory_leave_pointer(&self) -> Vec<LabelledInstruction>
pub fn write_value_to_memory_leave_pointer(&self) -> Vec<LabelledInstruction>
Return the code to write a value of this type to memory
BEFORE: _ [value] *address
AFTER: _ (*address + self.stack_size())
Sourcepub fn write_value_to_memory_pop_pointer(&self) -> Vec<LabelledInstruction>
pub fn write_value_to_memory_pop_pointer(&self) -> Vec<LabelledInstruction>
Return the code to write a value of this type to memory
BEFORE: _ [value] *address
AFTER: _
Sourcepub fn read_value_from_input(
&self,
input_source: InputSource,
) -> Vec<LabelledInstruction>
pub fn read_value_from_input( &self, input_source: InputSource, ) -> Vec<LabelledInstruction>
Return the code to read a value of this type from the specified input source
BEFORE: _
AFTER: _ [value]
Sourcepub fn write_value_to_stdout(&self) -> Vec<LabelledInstruction>
pub fn write_value_to_stdout(&self) -> Vec<LabelledInstruction>
Return the code to write a value of this type to standard output
BEFORE: _ [value]
AFTER: _
Sourcepub fn compare_elem_of_stack_size(stack_size: usize) -> Vec<LabelledInstruction>
pub fn compare_elem_of_stack_size(stack_size: usize) -> Vec<LabelledInstruction>
Return the code that compares two elements of this stack-size.
BEFORE: _ [self] [other]
AFTER: _ (self == other)
Sourcepub fn compare(&self) -> Vec<LabelledInstruction>
pub fn compare(&self) -> Vec<LabelledInstruction>
Return the code that compares two elements of this type.
BEFORE: _ [self] [other]
AFTER: _ (self == other)
Sourcepub fn variant_name(&self) -> String
pub fn variant_name(&self) -> String
Return a string matching how the variant looks in source code
pub fn random_elements(&self, count: usize) -> Vec<Vec<BFieldElement>>
pub fn seeded_random_element(&self, rng: &mut impl Rng) -> Vec<BFieldElement>
Trait Implementations§
Source§impl From<MainElementType> for DataType
impl From<MainElementType> for DataType
Source§fn from(value: MainElementType) -> Self
fn from(value: MainElementType) -> Self
Converts to this type from the input type.
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnwindSafe for DataType
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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 more