pub trait OrSyscallThrow<T> {
// Required methods
fn or_syscall_throw(self, callno: SyscallNo) -> T;
fn or_syscall_exn(self, callno: SyscallNo) -> Result<T, LibraryExn>;
}Expand description
Extension trait for turning a failed raw syscall into the SDK’s syscall
exception. A SysErr is only the error code, so the caller names the
syscall; the exception carries both (see
SyscallExn).
Required Methods§
Sourcefn or_syscall_throw(self, callno: SyscallNo) -> T
fn or_syscall_throw(self, callno: SyscallNo) -> T
On Err, throw the syscall exception for callno (see
syscall_throw). On Ok, return the value.
Sourcefn or_syscall_exn(self, callno: SyscallNo) -> Result<T, LibraryExn>
fn or_syscall_exn(self, callno: SyscallNo) -> Result<T, LibraryExn>
On Err, convert to the LibraryExn that
or_syscall_throw would throw (see
syscall_exn).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".