fdf Struct ZirconHandle Copy item path pub struct ZirconHandle();
Expand description An object representing a Zircon
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.
Initialize a handle backed by ZX_HANDLE_INVALID, the only safe non-handle.
If a raw handle is obtained from some other source, this method converts
it into a type-safe owned handle.
§ Safety
raw
must either be a valid handle (i.e. not dangling), or
ZX_HANDLE_INVALID
. If raw
is a valid handle, then either:
raw
may be closed manually and the returned Handle
must not be
dropped.
Or raw
must not be closed until the returned Handle
is dropped, at
which time it will close raw
.
Get a reference to the handle. One important use of such a reference is
for object_wait_many
.
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).
Set and clear userspace-accessible signal bits on an object. Wraps the
zx_object_signal
syscall.
Causes packet delivery on the given port when the object changes state and matches signals.
zx_object_wait_async
syscall.
Get the [Property::NAME] property for this object.
Read more Set the [Property::NAME] property for this object.
Read more Returns the koid (kernel object ID) for this handle.
Formats the value using the given formatter.
Read more Executes the destructor for this type.
Read more Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
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.
Read more Converts the handle into it’s raw representation.
Read more Creates an instance of this type from a handle.
Read more 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.
Compares and returns the maximum of two values.
Read more Compares and returns the minimum of two values.
Read more Restrict a value to a certain interval.
Read more Tests for self
and other
values to be equal, and is used by ==
.
Tests for !=
. The default implementation is almost always sufficient,
and should not be overridden without very good reason.
This method returns an ordering between
self
and
other
values if one exists.
Read more Tests less than (for
self
and
other
) and is used by the
<
operator.
Read more Tests less than or equal to (for
self
and
other
) and is used by the
<=
operator.
Read more Tests greater than (for
self
and
other
) and is used by the
>
operator.
Read more Tests greater than or equal to (for
self
and
other
) and is used by
the
>=
operator.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From <T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.