snarkvm_console_program/data/literal/
to_bits.rsuse super::*;
impl<N: Network> ToBits for Literal<N> {
fn write_bits_le(&self, vec: &mut Vec<bool>) {
(&self).write_bits_le(vec);
}
fn write_bits_be(&self, vec: &mut Vec<bool>) {
(&self).write_bits_be(vec);
}
}
impl<N: Network> ToBits for &Literal<N> {
fn write_bits_le(&self, vec: &mut Vec<bool>) {
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.as_bytes().write_bits_le(vec),
}
}
fn write_bits_be(&self, vec: &mut Vec<bool>) {
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.as_bytes().write_bits_be(vec),
}
}
}