pub trait Syscall<K, Args, Ret>:
Send
+ Sync
+ 'static {
// Required method
fn link(
self,
linker: &mut Linker<K>,
module: &'static str,
name: &'static str,
) -> Result<(), Error>;
}Expand description
A Syscall is a function in the form fn(Context<'_, K>, I...) -> R where:
Kis the kernel type. Constrain this to the precise kernel operations you need, or even a specific kernel implementation.I..., the syscall parameters, are 0-8 types, each one ofu32,u64,i32, ori64.Ris a type implementingIntoControlFlow. This is usually one of:kernel::Result<T>orControlFlow<T>whereT, the return value type, isSyscallSafe.Abortfor syscalls that only abort (revert) the currently running actor.
You generally shouldn’t implement this trait yourself.