pub enum Literal {
Bool(bool),
U32(u32),
U64(u64),
U128(u128),
I128(i128),
Bfe(BFieldElement),
Xfe(XFieldElement),
Digest(Digest),
}Variants§
Bool(bool)
U32(u32)
U64(u64)
U128(u128)
I128(i128)
Bfe(BFieldElement)
Xfe(XFieldElement)
Digest(Digest)
Implementations§
Source§impl Literal
impl Literal
pub fn data_type(&self) -> DataType
Sourcepub fn as_xfe(&self) -> XFieldElement
pub fn as_xfe(&self) -> XFieldElement
§Panics
Panics if self is anything but an extension field element.
Sourcepub fn push_to_stack_code(&self) -> Vec<LabelledInstruction>
pub fn push_to_stack_code(&self) -> Vec<LabelledInstruction>
The code to push the literal to the stack.
Sourcepub fn pop_from_stack(
data_type: DataType,
stack: &mut Vec<BFieldElement>,
) -> Self
pub fn pop_from_stack( data_type: DataType, stack: &mut Vec<BFieldElement>, ) -> Self
§Panics
- if the stack is too shallow
- if the top of the stack does not contain an element of the requested type
- if the element is incorrectly
BFieldCodecencoded
Trait Implementations§
Source§impl<'arbitrary> Arbitrary<'arbitrary> for Literal
impl<'arbitrary> Arbitrary<'arbitrary> for Literal
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Generate an arbitrary value of
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Get a size hint for how many bytes out of an
Unstructured this type
needs to construct itself. Read moreimpl Copy for Literal
impl Eq for Literal
impl StructuralPartialEq for Literal
Auto Trait Implementations§
impl Freeze for Literal
impl RefUnwindSafe for Literal
impl Send for Literal
impl Sync for Literal
impl Unpin for Literal
impl UnwindSafe for Literal
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§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