byodb_rust/api/error.rs
1//! Errors returned by functions in this crate.
2pub use crate::core::error::{MmapError, NodeError, TreeError};
3
4/// An error that occurred during a transaction.
5#[derive(thiserror::Error, Debug)]
6pub enum TxnError {
7 /// An error whose root cause is due to an erroneous B+ tree operation,
8 /// e.g. deleting a non-existent key.
9 #[error("Tree error: {0}")]
10 Tree(#[from] TreeError),
11 /// A system error with the memory map or its underlying file.
12 #[error("Page error: {0}")]
13 Mmap(#[from] MmapError),
14}