#[non_exhaustive]pub enum ErrorCode {
Show 16 variants
InvalidArgument,
NotDeclared,
WrongKind,
Conflict,
UnsafeSite,
BytesMismatch,
OutOfMemory,
WrongPhase,
Unsupported,
Internal,
NotFound,
AlreadyExists,
Suspended,
Limit,
Disabled,
Other(AnvilResult),
}Expand description
Why Anvil or a service refused a call: an AnvilResult other than
ANVIL_OK.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidArgument
ANVIL_ERROR_INVALID_ARGUMENT.
NotDeclared
ANVIL_ERROR_NOT_DECLARED: an unknown symbol or setting, a raw pointer
into eu4.exe, or a symbol the game build declares absent.
WrongKind
ANVIL_ERROR_WRONG_KIND: e.g. a pointer swap on a function symbol.
Conflict
ANVIL_ERROR_CONFLICT: overlaps another change at a different address.
UnsafeSite
ANVIL_ERROR_UNSAFE_SITE.
BytesMismatch
ANVIL_ERROR_BYTES_MISMATCH.
OutOfMemory
ANVIL_ERROR_OUT_OF_MEMORY.
WrongPhase
ANVIL_ERROR_WRONG_PHASE: e.g. a group inside load, or a world read
off the game’s main thread.
Unsupported
ANVIL_ERROR_UNSUPPORTED: also a function the running host or service
is too old to have.
Internal
ANVIL_ERROR_INTERNAL.
NotFound
ANVIL_ERROR_NOT_FOUND.
AlreadyExists
ANVIL_ERROR_ALREADY_EXISTS.
Suspended
ANVIL_ERROR_SUSPENDED: the caller is suspended in this session
(ironman, multiplayer). Since Anvil 1.17.0.
Limit
ANVIL_ERROR_LIMIT: more than a service takes at once; nothing of the
call was done. Since Anvil 1.17.0.
Disabled
ANVIL_ERROR_DISABLED: the player turned this module off
(Host::module). Since Anvil 1.22.0 (working
number; ADR 0011).
Other(AnvilResult)
A result this crate does not know.
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub const fn from_result(result: AnvilResult) -> Option<Self>
pub const fn from_result(result: AnvilResult) -> Option<Self>
The code of result; None for ANVIL_OK.
Sourcepub const fn result(self) -> AnvilResult
pub const fn result(self) -> AnvilResult
The AnvilResult of the code, never ANVIL_OK.
Sourcepub const fn description(self) -> &'static str
pub const fn description(self) -> &'static str
The words Anvil’s log uses for it, as anvil.hpp’s result_name.