pub struct ZirconHandle(/* private fields */);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.
Implementations§
Source§impl NullableHandle
impl NullableHandle
Sourcepub const fn invalid() -> NullableHandle
pub const fn invalid() -> NullableHandle
Initialize a handle backed by ZX_HANDLE_INVALID, the only safe non-handle.
Sourcepub const unsafe fn from_raw(raw: u32) -> NullableHandle
pub const unsafe fn from_raw(raw: u32) -> NullableHandle
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:
rawmay be closed manually and the returnedNullableHandlemust not be dropped.- Or
rawmust not be closed until the returnedNullableHandleis dropped, at which time it will closeraw.
pub const fn raw_handle(&self) -> u32
pub fn into_raw(self) -> u32
pub fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
pub const fn is_invalid(&self) -> bool
pub fn duplicate_handle(&self, rights: Rights) -> Result<NullableHandle, Status>
pub fn replace_handle(self, rights: Rights) -> Result<NullableHandle, Status>
pub fn signal( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
pub fn wait_one( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> WaitResult
pub fn wait_async( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
pub fn wait_item(&self, signals: Signals) -> WaitItem<'_>
pub fn get_name(&self) -> Result<Name, Status>
pub fn set_name(&self, name: &Name) -> Result<(), Status>
pub fn basic_info(&self) -> Result<HandleBasicInfo, Status>
pub fn count_info(&self) -> Result<HandleCountInfo, Status>
pub fn koid(&self) -> Result<Koid, Status>
Trait Implementations§
Source§impl AsHandleRef for NullableHandle
impl AsHandleRef for NullableHandle
Source§fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
fn as_handle_ref(&self) -> Unowned<'_, NullableHandle>
object_wait_many.Source§impl Debug for NullableHandle
impl Debug for NullableHandle
Source§impl From<Bti> for NullableHandle
impl From<Bti> for NullableHandle
Source§fn from(x: Bti) -> NullableHandle
fn from(x: Bti) -> NullableHandle
Source§impl From<Channel> for NullableHandle
impl From<Channel> for NullableHandle
Source§fn from(x: Channel) -> NullableHandle
fn from(x: Channel) -> NullableHandle
Source§impl<Reference, Output> From<Clock<Reference, Output>> for NullableHandle
impl<Reference, Output> From<Clock<Reference, Output>> for NullableHandle
Source§fn from(x: Clock<Reference, Output>) -> NullableHandle
fn from(x: Clock<Reference, Output>) -> NullableHandle
Source§impl From<Counter> for NullableHandle
impl From<Counter> for NullableHandle
Source§fn from(x: Counter) -> NullableHandle
fn from(x: Counter) -> NullableHandle
Source§impl From<DebugLog> for NullableHandle
impl From<DebugLog> for NullableHandle
Source§fn from(x: DebugLog) -> NullableHandle
fn from(x: DebugLog) -> NullableHandle
Source§impl From<Event> for NullableHandle
impl From<Event> for NullableHandle
Source§fn from(x: Event) -> NullableHandle
fn from(x: Event) -> NullableHandle
Source§impl From<EventPair> for NullableHandle
impl From<EventPair> for NullableHandle
Source§fn from(x: EventPair) -> NullableHandle
fn from(x: EventPair) -> NullableHandle
Source§impl From<Exception> for NullableHandle
impl From<Exception> for NullableHandle
Source§fn from(x: Exception) -> NullableHandle
fn from(x: Exception) -> NullableHandle
Source§impl<R, W> From<Fifo<R, W>> for NullableHandle
impl<R, W> From<Fifo<R, W>> for NullableHandle
Source§fn from(x: Fifo<R, W>) -> NullableHandle
fn from(x: Fifo<R, W>) -> NullableHandle
Source§impl From<Guest> for NullableHandle
impl From<Guest> for NullableHandle
Source§fn from(x: Guest) -> NullableHandle
fn from(x: Guest) -> NullableHandle
Source§impl From<Handle> for NullableHandle
impl From<Handle> for NullableHandle
Source§fn from(h: Handle) -> NullableHandle
fn from(h: Handle) -> NullableHandle
Source§impl<K, T> From<Interrupt<K, T>> for NullableHandlewhere
K: InterruptKind,
T: Timeline,
impl<K, T> From<Interrupt<K, T>> for NullableHandlewhere
K: InterruptKind,
T: Timeline,
Source§fn from(x: Interrupt<K, T>) -> NullableHandle
fn from(x: Interrupt<K, T>) -> NullableHandle
Source§impl From<Iob> for NullableHandle
impl From<Iob> for NullableHandle
Source§fn from(x: Iob) -> NullableHandle
fn from(x: Iob) -> NullableHandle
Source§fn from(x: IobSharedRegion) -> NullableHandle
fn from(x: IobSharedRegion) -> NullableHandle
Source§impl From<Iommu> for NullableHandle
impl From<Iommu> for NullableHandle
Source§fn from(x: Iommu) -> NullableHandle
fn from(x: Iommu) -> NullableHandle
Source§impl From<Job> for NullableHandle
impl From<Job> for NullableHandle
Source§fn from(x: Job) -> NullableHandle
fn from(x: Job) -> NullableHandle
Source§impl From<Msi> for NullableHandle
impl From<Msi> for NullableHandle
Source§fn from(x: Msi) -> NullableHandle
fn from(x: Msi) -> NullableHandle
Source§impl From<Pager> for NullableHandle
impl From<Pager> for NullableHandle
Source§fn from(x: Pager) -> NullableHandle
fn from(x: Pager) -> NullableHandle
Source§impl From<PciDevice> for NullableHandle
impl From<PciDevice> for NullableHandle
Source§fn from(x: PciDevice) -> NullableHandle
fn from(x: PciDevice) -> NullableHandle
Source§impl From<Pmt> for NullableHandle
impl From<Pmt> for NullableHandle
Source§fn from(x: Pmt) -> NullableHandle
fn from(x: Pmt) -> NullableHandle
Source§impl From<Port> for NullableHandle
impl From<Port> for NullableHandle
Source§fn from(x: Port) -> NullableHandle
fn from(x: Port) -> NullableHandle
Source§impl From<Process> for NullableHandle
impl From<Process> for NullableHandle
Source§fn from(x: Process) -> NullableHandle
fn from(x: Process) -> NullableHandle
Source§impl From<Profile> for NullableHandle
impl From<Profile> for NullableHandle
Source§fn from(x: Profile) -> NullableHandle
fn from(x: Profile) -> NullableHandle
Source§impl From<Resource> for NullableHandle
impl From<Resource> for NullableHandle
Source§fn from(x: Resource) -> NullableHandle
fn from(x: Resource) -> NullableHandle
Source§impl From<Socket> for NullableHandle
impl From<Socket> for NullableHandle
Source§fn from(x: Socket) -> NullableHandle
fn from(x: Socket) -> NullableHandle
Source§impl From<Stream> for NullableHandle
impl From<Stream> for NullableHandle
Source§fn from(x: Stream) -> NullableHandle
fn from(x: Stream) -> NullableHandle
Source§impl From<SuspendToken> for NullableHandle
impl From<SuspendToken> for NullableHandle
Source§fn from(x: SuspendToken) -> NullableHandle
fn from(x: SuspendToken) -> NullableHandle
Source§impl From<Thread> for NullableHandle
impl From<Thread> for NullableHandle
Source§fn from(x: Thread) -> NullableHandle
fn from(x: Thread) -> NullableHandle
Source§impl<T> From<Timer<T>> for NullableHandlewhere
T: Timeline,
impl<T> From<Timer<T>> for NullableHandlewhere
T: Timeline,
Source§fn from(x: Timer<T>) -> NullableHandle
fn from(x: Timer<T>) -> NullableHandle
Source§impl From<Vcpu> for NullableHandle
impl From<Vcpu> for NullableHandle
Source§fn from(x: Vcpu) -> NullableHandle
fn from(x: Vcpu) -> NullableHandle
Source§impl From<Vmar> for NullableHandle
impl From<Vmar> for NullableHandle
Source§fn from(x: Vmar) -> NullableHandle
fn from(x: Vmar) -> NullableHandle
Source§impl From<Vmo> for NullableHandle
impl From<Vmo> for NullableHandle
Source§fn from(x: Vmo) -> NullableHandle
fn from(x: Vmo) -> NullableHandle
Source§impl Hash for NullableHandle
impl Hash for NullableHandle
Source§impl Ord for NullableHandle
impl Ord for NullableHandle
Source§fn cmp(&self, other: &NullableHandle) -> Ordering
fn cmp(&self, other: &NullableHandle) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NullableHandle
impl PartialEq for NullableHandle
Source§fn eq(&self, other: &NullableHandle) -> bool
fn eq(&self, other: &NullableHandle) -> bool
self and other values to be equal, and is used by ==.