toboggan_kv/error.rs
1#[derive(Debug)]
2pub enum Error {
3 #[cfg(not(target_arch = "wasm32"))]
4 Sled(sled::Error),
5}
6
7#[cfg(not(target_arch = "wasm32"))]
8impl From<sled::Error> for Error {
9 fn from(e: sled::Error) -> Self {
10 Self::Sled(e)
11 }
12}
13
14impl std::convert::From<Error> for std::io::Error {
15 fn from(error: Error) -> Self {
16 use std::io::ErrorKind;
17 std::io::Error::new(ErrorKind::Other, format!("{:?}", error))
18 }
19}