pub enum StoreError {
Io {
path: String,
reason: String,
},
NotWritable,
}Expand description
What can go wrong closing an episode, as distinct from an outcome that is not Closed.
An outcome is a fact about the episode; an error is a fact about the disk, or about a
caller that reached the write path without saying it meant to.
use majordomus_cli::session::{Episode, EpisodeId, Outcome, SessionStore, StoreError};
use std::path::Path;
let dir = tempfile::tempdir().unwrap();
let id = EpisodeId::parse("s-20260910205542-e2a6").unwrap();
let episode = Episode::opening(id, Path::new("/r"))
.opened_at("2026-09-10T20:55:42Z", "master", "9f3a2a0", 1_000);
let err = SessionStore::read_only(dir.path())
.close(&episode, Outcome::Closed, String::new)
.expect_err("a refusal");
assert!(matches!(err, StoreError::NotWritable));Variants§
Io
A directory or file of the store could not be created, read or written.
NotWritable
The domain’s write path was reached without the opt-in. Additive by construction: while the shell tool owns the writes, a caller that has not said so explicitly is refused rather than allowed to produce a second writer for one record.
Trait Implementations§
Source§impl Debug for StoreError
impl Debug for StoreError
Source§impl Display for StoreError
impl Display for StoreError
Source§impl Error for StoreError
impl Error for StoreError
1.30.0 · 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()
Auto Trait Implementations§
impl Freeze for StoreError
impl RefUnwindSafe for StoreError
impl Send for StoreError
impl Sync for StoreError
impl Unpin for StoreError
impl UnsafeUnpin for StoreError
impl UnwindSafe for StoreError
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