Skip to main content

encode_snapshot_bounded

Function encode_snapshot_bounded 

Source
pub fn encode_snapshot_bounded<S: Copy, E: Copy>(
    snapshot: S,
    output: &mut [u8],
    max_len: usize,
    error: E,
    encode: for<'encoder> fn(S, &mut SnapshotEncoder<'encoder, E>) -> Result<(), E>,
) -> Result<usize, E>
Expand description

Encodes one immutable snapshot under an aggregate byte cap.

Capacity and aggregate-limit failures occur before the output is modified. The encode_snapshot snapshot contract also applies.