1mod boxed;
8pub mod locked_memory;
9pub mod memories;
10mod types;
11pub mod utils;
12
13pub use thiserror::Error as DeriveError;
14pub use types::Bytes;
15
16pub const DEBUG_MSG: &str = "Content of Locked Memory is hidden";
18
19#[derive(Debug, DeriveError)]
21pub enum MemoryError {
22 #[error("encryption error")]
23 EncryptionError,
24
25 #[error("decryption error")]
26 DecryptionError,
27
28 #[error("illegal non-contiguous size")]
29 NCSizeNotAllowed,
30
31 #[error("error while refreshing non-contiguous memory")]
32 NCRefreshError,
33
34 #[error("lock unavailable")]
35 LockNotAvailable,
36
37 #[error("file system error")]
38 FileSystemError,
39
40 #[error("illegal zero-sized value provided")]
41 ZeroSizedNotAllowed,
42
43 #[error("failed to allocate memory ({0})")]
44 Allocation(String),
45
46 #[error("intended operation failed: ({0})")]
47 Operation(String),
48
49 #[error("illegal tentative of using zeroized memory")]
50 IllegalZeroizedUsage,
51}
52
53pub trait ZeroizeOnDrop {}