[][src]Struct sunrise_libuser::types::ServerPort

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

The server side of an IPC Port. Allows listening for connections, providing a session on which to answer remote procedures from.

Usually obtained by registering a service through the sm: service manager, or by calling manage_named_port to obtained a kernel-managed port.

Implementations

impl ServerPort[src]

pub fn accept(&self) -> Result<ServerSession, Error>[src]

Accepts a connection to the port, returning a server session on which to listen and reply to IPC request.

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

Waits for the server to receive a connection.

Once this function returns, the next call to ServerPort::accept() is guaranteed not to block. Attention: Because accept does not have any non-blocking mode, it is dangerous to share a ServerPort across multiple futures or threads (since multiple threads or futures will get woken up and attempt accepting, but only one accept will not block).

If you wish to wait on a server port from multiple threads, please ensure that calls to the accept functions are wrapped in a mutex.

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 ServerPort[src]

Auto Trait Implementations

impl RefUnwindSafe for ServerPort

impl Send for ServerPort

impl Sync for ServerPort

impl Unpin for ServerPort

impl UnwindSafe for ServerPort

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.