Trait magenta::HandleBased [] [src]

pub trait HandleBased: AsHandleRef + From<Handle> + Into<Handle> {
    fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status> { ... }
fn replace_handle(self, rights: Rights) -> Result<Self, Status> { ... } }

A trait implemented by all handle-based types.

Note: it is reasonable for user-defined objects wrapping a handle to implement this trait. For example, a specific interface in some protocol might be represented as a newtype of Channel, and implement the as_handle_ref method and the From<Handle> trait to facilitate conversion from and to the interface.

Provided Methods

Duplicate a handle, possibly reducing the rights available. Wraps the mx_handle_duplicate syscall.

Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the mx_handle_replace syscall.

Implementors