base64::engine

Trait DecodeEstimate

source
pub trait DecodeEstimate {
    // Required method
    fn decoded_len_estimate(&self) -> usize;
}
Expand description

The decode estimate used by an engine implementation. Users do not need to interact with this; it is only for engine implementors.

Implementors may store relevant data here when constructing this to avoid having to calculate them again during actual decoding.

Required Methods§

source

fn decoded_len_estimate(&self) -> usize

Returns a conservative (err on the side of too big) estimate of the decoded length to use for pre-allocating buffers, etc.

The estimate must be no larger than the next largest complete triple of decoded bytes. That is, the final quad of tokens to decode may be assumed to be complete with no padding.

Implementors§