pub struct ErrorCode(/* private fields */);Expand description
Wire-level error code. Every code is a Lisp-style symbol string,
rendered as the bare token after :code in the response envelope.
The wire surface is open: well-known engine-emitted codes are
associated &str constants on the type, while script-raised codes
(via (error 'symbol "msg")) flow through the same channel without
a sentinel. Clients pattern-match identically on engine and script
codes — adding a new well-known code is a non-breaking change.
Implementations§
Source§impl ErrorCode
impl ErrorCode
pub const ARGS: &str = "args"
pub const CONFIG: &str = "config"
pub const DB: &str = "db"
pub const SERVER: &str = "server"
pub const FINANCE: &str = "finance"
pub const SCRIPT: &str = "script"
pub const PARSE: &str = "parse"
pub const COMPILE: &str = "compile"
pub const RUNTIME: &str = "runtime"
pub const AUTH: &str = "auth"
pub const INTERRUPTED: &str = "interrupted"
Sourcepub const NO_CONVERSION: &str = "no-conversion"
pub const NO_CONVERSION: &str = "no-conversion"
convert-commodity found no Price row linking source and
target in either direction. A host-classification label (not a
raised condition): convert-commodity’s host fn returns Err, the
classifier lifts it here, and the remedy differs from a commodity
mismatch (add a price row vs. avoid the cross-commodity arithmetic).
Note: commodity-mismatch is NOT a const here — unlike no-conversion
it is a raised condition (the guest throws $nomi_error with the
reader-folded symbol code COMMODITY-MISMATCH; ADR-0026), so it rides
the ScriptRaised path with its code verbatim, like any script
(error 'sym …). It needs no well-known const.
pub fn new(symbol: impl Into<String>) -> Self
pub fn as_symbol(&self) -> &str
Trait Implementations§
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnsafeUnpin for ErrorCode
impl UnwindSafe for ErrorCode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more