pub enum Error {
AlreadyExists(PathBuf),
NotFound(PathBuf),
ProtocolMismatch {
found: u32,
expected: u32,
},
Io(Error),
Serde(Error),
}Expand description
Errors from the file adapter itself.
Distinct from Response::Error: that is the game rejecting a request
(illegal action); these are the file misbehaving (missing, already
exists, unreadable, wrong protocol version).
Variants§
AlreadyExists(PathBuf)
FileSession::create was asked to write where a file already exists.
NotFound(PathBuf)
FileSession::handle was asked to load a path with no file.
ProtocolMismatch
The save was written by an incompatible PROTOCOL_VERSION.
Fields
Io(Error)
Reading or writing the save file failed.
Serde(Error)
The save file did not parse, or a state failed to serialize.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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 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