[][src]Trait sunrise_libuser::example::IExample4Async

pub trait IExample4Async {
    fn function<'a>(
        &'a mut self,
        work_queue: WorkQueue<'static>,
        very_large_thing: &'a u8
    ) -> FutureObj<'a, Result<SharedMemory, Error>>; fn dispatch<'a>(
        &'a mut self,
        work_queue: WorkQueue<'static>,
        cmdid: u32,
        buf: &'a mut [u8]
    ) -> FutureObj<Result<(), Error>> { ... } }

There are two more kinds of types that are important: buffers and handles.

When passing around "raw" arguments and return values, there is only a bit less than 0x100 bytes available. This can be inconvenient when trying to move around large chunks of data, such as trying to read from a file. To remedy this, buffers may be used, which allows the user to pass a pointer to a chunk of data to a remote process, which can either read or write from it (depending on if it's a return buffer or an argument buffer).

Handles are used to pass around "special" types. Examples of handles include process, readable_event, server_port, client_session, and many more.

Required methods

fn function<'a>(
    &'a mut self,
    work_queue: WorkQueue<'static>,
    very_large_thing: &'a u8
) -> FutureObj<'a, Result<SharedMemory, Error>>

Here's a simple function taking a buffer as an argument and returning a client handle.

A buffer takes the format buffer<data_type, transfer_type, size>. To find the correct transfer_type to use, look at the IPC Marshalling page of switchbrew. Make sure data_type and size matches!

The format for a handle is handle<move/copy, type>.

Loading content...

Provided methods

fn dispatch<'a>(
    &'a mut self,
    work_queue: WorkQueue<'static>,
    cmdid: u32,
    buf: &'a mut [u8]
) -> FutureObj<Result<(), Error>>

Handle an incoming IPC request.

Loading content...

Implementors

Loading content...