snarkvm_circuit_program/data/literal/
to_bits.rsuse super::*;
impl<A: Aleo> ToBits for Literal<A> {
type Boolean = Boolean<A>;
fn write_bits_le(&self, vec: &mut Vec<Boolean<A>>) {
(&self).write_bits_le(vec);
}
fn write_bits_be(&self, vec: &mut Vec<Boolean<A>>) {
(&self).write_bits_be(vec);
}
}
impl<A: Aleo> ToBits for &Literal<A> {
type Boolean = Boolean<A>;
fn write_bits_le(&self, vec: &mut Vec<Boolean<A>>) {
match self {
Literal::Address(literal) => literal.write_bits_le(vec),
Literal::Boolean(literal) => literal.write_bits_le(vec),
Literal::Field(literal) => literal.write_bits_le(vec),
Literal::Group(literal) => literal.write_bits_le(vec),
Literal::I8(literal) => literal.write_bits_le(vec),
Literal::I16(literal) => literal.write_bits_le(vec),
Literal::I32(literal) => literal.write_bits_le(vec),
Literal::I64(literal) => literal.write_bits_le(vec),
Literal::I128(literal) => literal.write_bits_le(vec),
Literal::U8(literal) => literal.write_bits_le(vec),
Literal::U16(literal) => literal.write_bits_le(vec),
Literal::U32(literal) => literal.write_bits_le(vec),
Literal::U64(literal) => literal.write_bits_le(vec),
Literal::U128(literal) => literal.write_bits_le(vec),
Literal::Scalar(literal) => literal.write_bits_le(vec),
Literal::Signature(literal) => literal.write_bits_le(vec),
Literal::String(literal) => literal.write_bits_le(vec),
}
}
fn write_bits_be(&self, vec: &mut Vec<Boolean<A>>) {
match self {
Literal::Address(literal) => literal.write_bits_be(vec),
Literal::Boolean(literal) => literal.write_bits_be(vec),
Literal::Field(literal) => literal.write_bits_be(vec),
Literal::Group(literal) => literal.write_bits_be(vec),
Literal::I8(literal) => literal.write_bits_be(vec),
Literal::I16(literal) => literal.write_bits_be(vec),
Literal::I32(literal) => literal.write_bits_be(vec),
Literal::I64(literal) => literal.write_bits_be(vec),
Literal::I128(literal) => literal.write_bits_be(vec),
Literal::U8(literal) => literal.write_bits_be(vec),
Literal::U16(literal) => literal.write_bits_be(vec),
Literal::U32(literal) => literal.write_bits_be(vec),
Literal::U64(literal) => literal.write_bits_be(vec),
Literal::U128(literal) => literal.write_bits_be(vec),
Literal::Scalar(literal) => literal.write_bits_be(vec),
Literal::Signature(literal) => literal.write_bits_be(vec),
Literal::String(literal) => literal.write_bits_be(vec),
}
}
}