pub enum Error {
NotAStore(NotAStore),
Store(StoreError),
Parse(ParseError),
Policy {
code: &'static str,
message: String,
},
Io(Error),
}Expand description
Top-level error for dbmd-core operations.
Module-specific errors (ParseError, StoreError, NotAStore)
convert into this so a CLI command can bubble a single error type while
preserving the structured variant for --json rendering.
Variants§
NotAStore(NotAStore)
The path is not a db.md store (no DB.md at the root). Surfaced as the
machine-parseable code NOT_A_STORE with a non-zero exit.
Store(StoreError)
A store-level operation failed (walk, locate, shard, sidecar read).
Parse(ParseError)
A markdown / frontmatter / DB.md parse failed.
Policy
A write was refused by a DB.md ## Policies rule (e.g. a frozen page).
Carries the structured validation code so the CLI can emit it verbatim.
Fields
Io(Error)
An underlying I/O failure.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<ParseError> for Error
impl From<ParseError> for Error
Source§fn from(source: ParseError) -> Self
fn from(source: ParseError) -> Self
Converts to this type from the input type.
Source§impl From<StoreError> for Error
impl From<StoreError> for Error
Source§fn from(source: StoreError) -> Self
fn from(source: StoreError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
impl !UnwindSafe for Error
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more