#[non_exhaustive]pub enum PaddingError {
PositionOutOfRange,
UnsupportedBlockSize,
BlockFull,
CorruptPadding,
}Expand description
A failure while adding or removing block padding.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
PositionOutOfRange
The requested padding position lies past the end of the block.
UnsupportedBlockSize
The block is longer than the scheme’s length encoding can describe.
PKCS#7, ANSI X9.23, and ISO 10126-2 record the padding count in a single byte and therefore cannot serve blocks of 256 bytes or more.
BlockFull
The block is already full, leaving no room for padding.
Schemes that must write at least one byte, such as PKCS#7 and ISO 7816-4, report this when the padding position equals the block length. Schemes that can add nothing at all, such as zero-byte padding, return a count of zero instead.
CorruptPadding
The trailing bytes of the block are not a valid encoding for the scheme.
Self-describing schemes such as PKCS#7 report this; schemes that encode no length, such as zero-byte padding, cannot detect corruption at all.
Trait Implementations§
Source§impl Clone for PaddingError
impl Clone for PaddingError
impl Copy for PaddingError
Source§impl Debug for PaddingError
impl Debug for PaddingError
Source§impl Display for PaddingError
impl Display for PaddingError
impl Eq for PaddingError
Source§impl Error for PaddingError
impl Error for PaddingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()