Struct Handle
pub struct Handle(/* private fields */);Expand description
An owned and valid Zircon handle to a kernel object.
This type 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 what operations are available.
§Lifecycle
This type closes the handle it owns when dropped.
§Layout
Option<Handle> is guaranteed to have the same layout and bit patterns as zx_handle_t.
Unlike many types in this crate it does not implement zerocopy traits because those are not
appropriate for types with real Drop implementations.
Implementations§
§impl Handle
impl Handle
pub fn check_raw_valid(raw: u32) -> Result<(), Status>
pub fn check_raw_valid(raw: u32) -> Result<(), Status>
Wraps the zx_handle_check_valid syscall.
Note that this does not guarantee that the handle is safe to pass to Handle::from_raw
in cases where another function may close the handle.
pub const fn raw_handle(&self) -> u32
pub const fn raw_handle(&self) -> u32
Returns the raw handle’s integer value.
Trait Implementations§
§impl Ord for Handle
impl Ord for Handle
§impl PartialOrd for Handle
impl PartialOrd for Handle
impl Eq for Handle
impl StructuralPartialEq for Handle
Auto Trait Implementations§
impl Freeze for Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnwindSafe for Handle
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
Source§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to Self