Skip to main content

OrSyscallThrow

Trait OrSyscallThrow 

Source
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§

Source

fn or_syscall_throw(self, callno: SyscallNo) -> T

On Err, throw the syscall exception for callno (see syscall_throw). On Ok, return the value.

Source

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".

Implementations on Foreign Types§

Source§

impl<T> OrSyscallThrow<T> for Result<T, SysErr>

Implementors§