pub enum SessionError {
Io(Error),
OldLayout,
Format {
log: String,
found: Option<String>,
},
Record {
log: String,
line: usize,
why: String,
},
Changed {
log: String,
},
}Expand description
Why a session cannot be read or saved. Reading is strict: a session with any record it cannot read is refused whole, and nothing is written.
Variants§
Io(Error)
The store failed.
OldLayout
The directory holds the single-file layout older than rig-session/2 (a
top-level *.jsonl); it is left as it is.
Format
A log’s header names a format other than FORMAT, or none; it is
left as it is.
Record
A record cannot be read, or its change does not apply.
Changed
The log moved on since the conversation saved to it was read: saving would lose the changes made there.
Trait Implementations§
Source§impl Debug for SessionError
impl Debug for SessionError
Source§impl Display for SessionError
impl Display for SessionError
Source§impl Error for SessionError
impl Error for SessionError
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<Error> for SessionError
impl From<Error> for SessionError
Source§impl From<SessionError> for UndoError
impl From<SessionError> for UndoError
Source§fn from(source: SessionError) -> Self
fn from(source: SessionError) -> Self
Converts to this type from the input type.
Source§impl From<SessionError> for Error
impl From<SessionError> for Error
Source§fn from(error: SessionError) -> Self
fn from(error: SessionError) -> Self
The store’s own error back; any other as
io::ErrorKind::InvalidData, so ? works in code that returns
io::Result.
Auto Trait Implementations§
impl !RefUnwindSafe for SessionError
impl !UnwindSafe for SessionError
impl Freeze for SessionError
impl Send for SessionError
impl Sync for SessionError
impl Unpin for SessionError
impl UnsafeUnpin for SessionError
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