pub trait BasicKernelInterface {
// Required methods
fn write(fd: FileDescriptor, buf: &[u8]) -> IOResult<usize>;
fn read(fd: FileDescriptor, buf: &mut [u8]) -> IOResult<usize>;
fn exit(code: usize) -> !;
}
Expand description
The BasicKernelInterface trait describes the functionality of several core system calls inside of the FPVM kernel.
Commonly, FPVMs delegate IO operations to custom file descriptors in the client
program. It is
a safe wrapper around the raw system calls available to the client
program.
In cases where the set of system calls defined in this trait need to be extended, an additional trait should be created that extends this trait.
Required Methods§
Sourcefn write(fd: FileDescriptor, buf: &[u8]) -> IOResult<usize>
fn write(fd: FileDescriptor, buf: &[u8]) -> IOResult<usize>
Write the given buffer to the given file descriptor.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.