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 kernel.
Commonly, embedded proving environments delegate IO operations to custom file descriptors.
This trait is a safe wrapper around the raw system calls available to the client
program
for host<->client communication.
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.