pub mod canister;
pub mod stable;
pub mod prelude {
pub use crate::{
cdk::types::{Cycles, Principal},
eager_static, ic_memory,
ids::{CanisterRole, SubnetRole},
memory::impl_storable_bounded,
storage::StorageError,
};
pub use serde::{Deserialize, Serialize};
}
use crate::{InternalError, InternalErrorOrigin};
use thiserror::Error as ThisError;
#[derive(Debug, ThisError)]
pub enum StorageError {
#[error(transparent)]
StableMemory(#[from] stable::StableMemoryError),
}
impl From<StorageError> for InternalError {
fn from(err: StorageError) -> Self {
Self::invariant(InternalErrorOrigin::Storage, err.to_string())
}
}