pub enum MemoryBankError {
Io(Error),
Parse(String),
DirectoryNotFound(PathBuf),
InvalidEntryPath {
file_path: PathBuf,
memory_dir: PathBuf,
},
}Expand description
Errors that can occur during memory bank operations
§Examples
ⓘ
use gestura_core::memory_bank::{MemoryBankError, load_from_memory_bank};
use std::path::Path;
match load_from_memory_bank(Path::new("invalid.md")).await {
Err(MemoryBankError::Io(e)) => println!("File not found: {}", e),
Err(MemoryBankError::Parse(msg)) => println!("Invalid format: {}", msg),
Err(MemoryBankError::DirectoryNotFound(path)) => println!("Directory not found: {}", path.display()),
Err(MemoryBankError::InvalidEntryPath { file_path, memory_dir }) => {
println!(
"Invalid entry path: {} (expected under {})",
file_path.display(),
memory_dir.display()
)
}
Ok(entry) => println!("Loaded: {}", entry.summary),
}Variants§
Io(Error)
I/O error during file operations (e.g., file not found, permission denied)
Parse(String)
Error parsing markdown content (e.g., missing required fields, invalid format)
DirectoryNotFound(PathBuf)
Memory bank directory not found at the expected location
InvalidEntryPath
An entry path was provided that is not within the workspace’s memory bank directory
Trait Implementations§
Source§impl Debug for MemoryBankError
impl Debug for MemoryBankError
Source§impl Display for MemoryBankError
impl Display for MemoryBankError
Source§impl Error for MemoryBankError
impl Error for MemoryBankError
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 MemoryBankError
impl !RefUnwindSafe for MemoryBankError
impl Send for MemoryBankError
impl Sync for MemoryBankError
impl Unpin for MemoryBankError
impl !UnwindSafe for MemoryBankError
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