1pub mod registry;
4pub mod traits;
5pub mod types;
6pub mod validate;
7
8pub use types::{Error, Result};
10
11pub use registry::ERROR_REGISTRY;
13
14#[allow(deprecated)]
16pub use traits::{ErrorRegistryExt, ResultExt, SecureErrorHandling};
17
18pub use validate as validation;
20
21#[cfg(feature = "std")]
23impl From<std::array::TryFromSliceError> for Error {
24 fn from(_: std::array::TryFromSliceError) -> Self {
25 Self::InvalidLength {
26 context: "array conversion",
27 expected: 0, actual: 0, }
30 }
31}
32
33#[cfg(feature = "std")]
34impl From<std::io::Error> for Error {
35 fn from(e: std::io::Error) -> Self {
36 Self::Other {
37 context: "I/O operation",
38 message: e.to_string(),
39 }
40 }
41}
42
43#[cfg(feature = "std")]
44use std::error::Error as StdError;
45
46#[cfg(feature = "std")]
48impl StdError for Error {}
49
50pub type CipherResult<T> = Result<T>;
52pub type HashResult<T> = Result<T>;
53pub type KeyResult<T> = Result<T>;
54pub type SignatureResult<T> = Result<T>;