[][src]Struct sunrise_libuser::types::ServerSession

#[repr(transparent)]pub struct ServerSession(pub Handle);

The server side of an IPC session.

Usually obtained by calling accept, but may also be obtained by calling the create_session syscall, providing a server/client session pair.

Implementations

impl ServerSession[src]

pub fn receive(
    &self,
    buf: &mut [u8],
    timeout: Option<usize>
) -> Result<(), Error>
[src]

Receives an IPC request from the session, waiting if none are available yet. The buffer should contain an empty message, optionally containing a C descriptor, and will contain the reply on output.

If a C descriptor is provided, it will be used as the buffer to copy the request's X descriptor into.

This is a low-level primitives that is usually wrapped by a higher-level library. Look at the ipc module for more information on the IPC message format.

pub fn reply(&self, buf: &mut [u8]) -> Result<(), Error>[src]

Replies to an IPC request on the given session. If the given session did not have a pending request, this function will error out.

This is a low-level primitives that is usually wrapped by a higher-level library. Look at the ipc module for more information on the IPC message format.

pub fn wait_async(
    &self,
    queue: WorkQueue
) -> impl Future<Output = Result<(), Error>> + Unpin
[src]

Waits for the server to receive a request.

Once this function returns, calling ServerSession::receive() is guaranteed not to block.

Panics

Panics if used from outside the context of a Future spawned on a libuser future executor. Please make sure you only call this function from a future spawned on a WaitableManager.

Trait Implementations

impl Debug for ServerSession[src]

Auto Trait Implementations

impl RefUnwindSafe for ServerSession

impl Send for ServerSession

impl Sync for ServerSession

impl Unpin for ServerSession

impl UnwindSafe for ServerSession

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SizedIPCBuffer for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.