Skip to main content

embedded_cal/
error.rs

1// SPDX-License-Identifier: MIT OR Apache-2.0
2// SPDX-FileCopyrightText: Inria-AIO, Cryspen, and Christian Amsüss
3//! Common error types.
4//!
5//! Errors here are exclusively zero-sized, as they are not generally actionable.
6
7/// Error indicating that a imported key's size does not match the given algorithm, or that the data
8/// was otherwise found flawed.
9#[derive(Debug)]
10pub struct ImportError;
11
12impl core::fmt::Display for ImportError {
13    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
14        f.write_str("data not valid for algorithm")
15    }
16}
17
18impl core::error::Error for ImportError {}