Trait Packable
pub trait Packable {
let N: u32;
// Required methods
pub fn pack(self) -> [Field; N];
pub fn unpack(fields: [Field; N]) -> Self;
}
Required methods
pub fn pack(self) -> [Field; N]
Packs the current value into a compact array of Field elements.
pub fn unpack(fields: [Field; N]) -> Self
Unpacks a compact array of Field elements into the original value.
Implementors
impl Packable for AddressNote
impl Packable for AztecAddress
impl<let M: u32, let N: u32> Packable for CompressedString<N, M>
impl Packable for ContractClassId
impl<let INITIAL_DELAY: u64, T> Packable for DelayedPublicMutableValues<T, INITIAL_DELAY>
where
T: Packable
where
T: Packable
impl Packable for EmbeddedCurvePoint
impl Packable for Empty
impl Packable for EthAddress
impl Packable for Field
impl Packable for FieldCompressedString
impl<let N: u32, T> Packable for HasArrayWithGenerics<T, N>
where
T: Packable
where
T: Packable
impl Packable for MockStruct
impl Packable for MockStruct
impl Packable for NoteMetadata
impl Packable for PartialUintNote
impl<Note> Packable for RetrievedNote<Note>
where
Note: Packable
where
Note: Packable
impl Packable for Smol
impl Packable for UintNote
impl Packable for ValueNote
impl<let M: u32, T> Packable for WithHash<T, M>
where
T: Packable<N = M>
where
T: Packable<N = M>
impl<let M: u32, T> Packable for [T; M]
where
T: Packable
where
T: Packable
Trait for efficiently packing and unpacking Noir types into and from arrays of Fields.
The
Packabletrait allows types to be serialized and deserialized with a focus on minimizing the size of the resulting Field array. This trait is used when storage efficiency is critical (e.g. when storing data in the contract's public storage).Associated Constants
N- The length of the Field array, known at compile time