#[non_exhaustive]pub enum StorageError {
InvalidKey,
TooLarge {
len: usize,
limit: usize,
},
QuotaExceeded,
Unavailable(String),
NotUtf8,
Io(String),
}Expand description
Why a storage operation did not do what it was asked.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidKey
The key breaks the rules: 1 to 128 bytes of a-z, 0-9, -, _ and ., not
starting with .. Nothing was read or written.
TooLarge
The value is len bytes, more than the limit it may be. Nothing was written, and
nothing was cut short.
QuotaExceeded
The disk or the browser’s quota is full. The value that was there is still there.
This run has no storage: no application identifier, no directory the platform can name, or a browser that refuses storage. The text says which.
NotUtf8
read_string found a value that is not UTF-8.
Io(String)
Any other failure, in the words the platform gave.
Trait Implementations§
Source§impl Clone for StorageError
impl Clone for StorageError
Source§impl Debug for StorageError
impl Debug for StorageError
Source§impl Display for StorageError
impl Display for StorageError
impl Eq for StorageError
Source§impl Error for StorageError
impl Error for StorageError
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()
Source§impl PartialEq for StorageError
impl PartialEq for StorageError
impl StructuralPartialEq for StorageError
Auto Trait Implementations§
impl Forget for StorageError
impl Freeze for StorageError
impl Move for StorageError
impl RefUnwindSafe for StorageError
impl Send for StorageError
impl Sync for StorageError
impl Unpin for StorageError
impl UnsafeUnpin for StorageError
impl UnwindSafe for StorageError
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