#[repr(transparent)]pub struct SysErr(pub i32);Expand description
Raw error code returned across the syscall boundary.
Wraps the i32 produced by a syscall; the known values are the
SyscallErrorCode constants, with
kSyscallErrorCodeNone (0) meaning success. Unknown codes are
preserved as-is, so Debug falls back to the numeric value.
Tuple Fields§
§0: i32Implementations§
Source§impl SysErr
impl SysErr
pub const fn const_write_cxs<const __N: usize>(&self, w: &mut ConstWriter<__N>)
pub const fn const_write_txs<const __N: usize>(&self, w: &mut ConstWriter<__N>)
Sourcepub const fn const_cxs_size(&self) -> usize
pub const fn const_cxs_size(&self) -> usize
Returns the CXS encoded size of this value in bytes.
Sourcepub const fn const_txs_size(&self) -> usize
pub const fn const_txs_size(&self) -> usize
Returns the TXS encoded size of this value in bytes.
Source§impl SysErr
impl SysErr
Sourcepub fn is_code(&self, code: SyscallErrorCode) -> bool
pub fn is_code(&self, code: SyscallErrorCode) -> bool
Returns whether this error carries exactly code.
Sourcepub fn is_none(&self) -> bool
pub fn is_none(&self) -> bool
Returns whether this is the success code (kSyscallErrorCodeNone).
Sourcepub fn is_storage_key_not_exist(self) -> bool
pub fn is_storage_key_not_exist(self) -> bool
Returns whether the syscall failed because the storage key does
not exist (kSyscallErrorCodeStorageKeyNotExist).
Sourcepub fn is_invalid_input(self) -> bool
pub fn is_invalid_input(self) -> bool
Returns whether the syscall rejected its input
(kSyscallErrorCodeInvalidSyscallInput).
Trait Implementations§
Source§impl ConstMaxSize for SysErr
impl ConstMaxSize for SysErr
Source§impl ConstMaxSize for SysErr
impl ConstMaxSize for SysErr
Source§impl ContractTypeRefSpec for SysErr
impl ContractTypeRefSpec for SysErr
Source§const INFO: ContractTypeInfo<'static>
const INFO: ContractTypeInfo<'static>
The type reference. Transitive type definitions are not carried here;
they are retained via the linker-anchor mechanism
(
__THRUPUT_SPEC_ANCHOR_ROOT) and resolved by spec-tool.Source§const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
const SIGNED_PREIMAGE: Option<&'static ContractTypeView<'static>> = _
How this type appears as a signed-token preimage
(
ContractTypeView::SignedToken’s payload): the type itself by
default, or None for a type-erased payload (the SDK’s Opaque
overrides this).impl Copy for SysErr
impl EncodesAs<SysErr> for SysErr
impl Eq for SysErr
Source§impl Error for SysErr
impl Error for SysErr
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 From<SyscallErrorCode> for SysErr
impl From<SyscallErrorCode> for SysErr
Source§fn from(code: SyscallErrorCode) -> SysErr
fn from(code: SyscallErrorCode) -> SysErr
Converts to this type from the input type.
Source§impl<'_r> ReadXDR<'_r> for SysErr
impl<'_r> ReadXDR<'_r> for SysErr
impl StructuralPartialEq for SysErr
Source§impl WriteXDR for SysErr
impl WriteXDR for SysErr
Source§fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
fn write_xdr<F, W>(&self, w: &mut W) -> Result<(), WriteError>where
W: Writer<F>,
Writes this value as XDR data to the writer. Read more
Source§unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
unsafe fn write_xdr_unchecked<F, W>(&self, w: &mut W)where
W: WriterUnchecked<F>,
Writes this value as XDR data to the writer, without runtime checks. Read more
Auto Trait Implementations§
impl Freeze for SysErr
impl RefUnwindSafe for SysErr
impl Send for SysErr
impl Sync for SysErr
impl Unpin for SysErr
impl UnsafeUnpin for SysErr
impl UnwindSafe for SysErr
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