#[non_exhaustive]pub enum OpError {
NotRun,
InvalidState,
OutOfMemory,
Other(u32),
}Expand description
Why an operation failed; the loader reads the game’s code for each variant by its constant’s name.
§Examples
use enshwick::inventory::{OpError, Outcome};
fn split(outcome: &Outcome) -> bool {
outcome.ops.iter().any(|op| op.error == Some(OpError::OutOfMemory))
}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.
NotRun
An operation before it failed, so it did not run; the loader’s name, not the game’s.
InvalidState
The item did not fit or does not exist.
OutOfMemory
The op log is full or more than 16 inventories are touched; split the batch.
Other(u32)
A code this crate does not name, as the game gave it.
Trait Implementations§
impl Copy for OpError
impl Eq for OpError
Source§impl FromScript for OpError
impl FromScript for OpError
Source§fn from_value(value: Value) -> Result<Self, ScriptError>
fn from_value(value: Value) -> Result<Self, ScriptError>
Available on crate feature
unstable only.The Rust value of
value. Read moreSource§impl IntoScript for OpError
impl IntoScript for OpError
Source§fn into_value(self) -> Value
fn into_value(self) -> Value
Available on crate feature
unstable only.The value as
Typed::TY shapes it.impl StructuralPartialEq for OpError
Auto Trait Implementations§
impl Freeze for OpError
impl RefUnwindSafe for OpError
impl Send for OpError
impl Sync for OpError
impl Unpin for OpError
impl UnsafeUnpin for OpError
impl UnwindSafe for OpError
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