Struct magenta::Handle
[−]
[src]
pub struct Handle(_);
An object representing a Magenta handle.
Internally, it is represented as a 32-bit integer, but this wrapper enforces
strict ownership semantics. The Drop
implementation closes the handle.
This type represents the most general reference to a kernel object, and can be interconverted to and from more specific types. Those conversions are not enforced in the type system; attempting to use them will result in errors returned by the kernel. These conversions don't change the underlying representation, but do change the type and thus what operations are available.
Methods
impl Handle
[src]
unsafe fn from_raw(raw: mx_handle_t) -> Handle
If a raw handle is obtained from some other source, this method converts it into a type-safe owned handle.
fn replace(self, rights: Rights) -> Result<Handle, Status>
Trait Implementations
impl Debug for Handle
[src]
impl Eq for Handle
[src]
impl PartialEq for Handle
[src]
fn eq(&self, __arg_0: &Handle) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Handle) -> bool
This method tests for !=
.
impl Hash for Handle
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl AsHandleRef for Handle
[src]
fn as_handle_ref(&self) -> HandleRef
Get a reference to the handle. One important use of such a reference is for object_wait_many
. Read more
fn raw_handle(&self) -> mx_handle_t
Interpret the reference as a raw handle (an integer type). Two distinct handles will have different raw values (so it can perhaps be used as a key in a data structure). Read more
fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
&self,
clear_mask: Signals,
set_mask: Signals
) -> Result<(), Status>
Set and clear userspace-accessible signal bits on an object. Wraps the mx_object_signal syscall. Read more
fn wait_handle(
&self,
signals: Signals,
deadline: mx_time_t
) -> Result<Signals, Status>
&self,
signals: Signals,
deadline: mx_time_t
) -> Result<Signals, Status>
Waits on a handle. Wraps the mx_object_wait_one syscall. Read more
fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts
) -> Result<(), Status>
Causes packet delivery on the given port when the object changes state and matches signals. mx_object_wait_async syscall. Read more
impl HandleBased for Handle
[src]
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
Duplicate a handle, possibly reducing the rights available. Wraps the mx_handle_duplicate syscall. Read more
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
Create a replacement for a handle, possibly reducing the rights available. This invalidates the original handle. Wraps the mx_handle_replace syscall. Read more