Trait fuchsia_zircon::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> { ... }
fn into_handle(self) -> Handle { ... }
fn from_handle(handle: Handle) -> Self { ... }
fn into_handle_based<H: HandleBased>(self) -> H { ... }
fn from_handle_based<H: HandleBased>(h: H) -> Self { ... } }

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 zx_handle_duplicate syscall.

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

Converts the value into its inner handle.

This is a convenience function which simply forwards to the Into trait.

Creates an instance of this type from a handle.

This is a convenience function which simply forwards to the From trait.

Creates an instance of another handle-based type from this value's inner handle.

Creates an instance of this type from the inner handle of another handle-based type.

Implementors