pub struct NullableHandle(/* 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 fn is_invalid(&self) -> bool
pub fn replace(self, rights: Rights) -> Result<NullableHandle, 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§fn raw_handle(&self) -> u32
fn raw_handle(&self) -> u32
Source§fn signal_handle(
&self,
clear_mask: Signals,
set_mask: Signals,
) -> Result<(), Status>
fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>
Source§fn wait_handle(
&self,
signals: Signals,
deadline: Instant<MonotonicTimeline>,
) -> WaitResult
fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> WaitResult
Source§fn wait_async_handle(
&self,
port: &Port,
key: u64,
signals: Signals,
options: WaitAsyncOpts,
) -> Result<(), Status>
fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>
Source§fn get_name(&self) -> Result<Name, Status>
fn get_name(&self) -> Result<Name, Status>
Source§fn set_name(&self, name: &Name) -> Result<(), Status>
fn set_name(&self, name: &Name) -> Result<(), Status>
Source§fn basic_info(&self) -> Result<HandleBasicInfo, Status>
fn basic_info(&self) -> Result<HandleBasicInfo, Status>
Source§fn count_info(&self) -> Result<HandleCountInfo, Status>
fn count_info(&self) -> Result<HandleCountInfo, Status>
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<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<T> From<ClientEnd<T>> for NullableHandle
impl<T> From<ClientEnd<T>> for NullableHandle
Source§fn from(client: ClientEnd<T>) -> NullableHandle
fn from(client: ClientEnd<T>) -> 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 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<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<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<NullableHandle> for Bti
impl From<NullableHandle> for Bti
Source§fn from(handle: NullableHandle) -> Bti
fn from(handle: NullableHandle) -> Bti
Source§impl From<NullableHandle> for Channel
impl From<NullableHandle> for Channel
Source§fn from(handle: NullableHandle) -> Channel
fn from(handle: NullableHandle) -> Channel
Source§impl<T> From<NullableHandle> for ClientEnd<T>
impl<T> From<NullableHandle> for ClientEnd<T>
Source§fn from(handle: NullableHandle) -> ClientEnd<T>
fn from(handle: NullableHandle) -> ClientEnd<T>
Source§impl<Reference, Output> From<NullableHandle> for Clock<Reference, Output>
impl<Reference, Output> From<NullableHandle> for Clock<Reference, Output>
Source§fn from(handle: NullableHandle) -> Clock<Reference, Output>
fn from(handle: NullableHandle) -> Clock<Reference, Output>
Source§impl From<NullableHandle> for Counter
impl From<NullableHandle> for Counter
Source§fn from(handle: NullableHandle) -> Counter
fn from(handle: NullableHandle) -> Counter
Source§impl From<NullableHandle> for DebugLog
impl From<NullableHandle> for DebugLog
Source§fn from(handle: NullableHandle) -> DebugLog
fn from(handle: NullableHandle) -> DebugLog
Source§impl From<NullableHandle> for Event
impl From<NullableHandle> for Event
Source§fn from(handle: NullableHandle) -> Event
fn from(handle: NullableHandle) -> Event
Source§impl From<NullableHandle> for EventPair
impl From<NullableHandle> for EventPair
Source§fn from(handle: NullableHandle) -> EventPair
fn from(handle: NullableHandle) -> EventPair
Source§impl From<NullableHandle> for Exception
impl From<NullableHandle> for Exception
Source§fn from(handle: NullableHandle) -> Exception
fn from(handle: NullableHandle) -> Exception
Source§impl<R, W> From<NullableHandle> for Fifo<R, W>
impl<R, W> From<NullableHandle> for Fifo<R, W>
Source§fn from(handle: NullableHandle) -> Fifo<R, W>
fn from(handle: NullableHandle) -> Fifo<R, W>
Source§impl From<NullableHandle> for Guest
impl From<NullableHandle> for Guest
Source§fn from(handle: NullableHandle) -> Guest
fn from(handle: NullableHandle) -> Guest
Source§impl<K, T> From<NullableHandle> for Interrupt<K, T>where
K: InterruptKind,
T: Timeline,
impl<K, T> From<NullableHandle> for Interrupt<K, T>where
K: InterruptKind,
T: Timeline,
Source§fn from(handle: NullableHandle) -> Interrupt<K, T>
fn from(handle: NullableHandle) -> Interrupt<K, T>
Source§impl From<NullableHandle> for Iob
impl From<NullableHandle> for Iob
Source§fn from(handle: NullableHandle) -> Iob
fn from(handle: NullableHandle) -> Iob
Source§impl From<NullableHandle> for Iommu
impl From<NullableHandle> for Iommu
Source§fn from(handle: NullableHandle) -> Iommu
fn from(handle: NullableHandle) -> Iommu
Source§impl From<NullableHandle> for Job
impl From<NullableHandle> for Job
Source§fn from(handle: NullableHandle) -> Job
fn from(handle: NullableHandle) -> Job
Source§impl From<NullableHandle> for Msi
impl From<NullableHandle> for Msi
Source§fn from(handle: NullableHandle) -> Msi
fn from(handle: NullableHandle) -> Msi
Source§impl From<NullableHandle> for Pager
impl From<NullableHandle> for Pager
Source§fn from(handle: NullableHandle) -> Pager
fn from(handle: NullableHandle) -> Pager
Source§impl From<NullableHandle> for PciDevice
impl From<NullableHandle> for PciDevice
Source§fn from(handle: NullableHandle) -> PciDevice
fn from(handle: NullableHandle) -> PciDevice
Source§impl From<NullableHandle> for Pmt
impl From<NullableHandle> for Pmt
Source§fn from(handle: NullableHandle) -> Pmt
fn from(handle: NullableHandle) -> Pmt
Source§impl From<NullableHandle> for Port
impl From<NullableHandle> for Port
Source§fn from(handle: NullableHandle) -> Port
fn from(handle: NullableHandle) -> Port
Source§impl From<NullableHandle> for Process
impl From<NullableHandle> for Process
Source§fn from(handle: NullableHandle) -> Process
fn from(handle: NullableHandle) -> Process
Source§impl From<NullableHandle> for Profile
impl From<NullableHandle> for Profile
Source§fn from(handle: NullableHandle) -> Profile
fn from(handle: NullableHandle) -> Profile
Source§impl From<NullableHandle> for Resource
impl From<NullableHandle> for Resource
Source§fn from(handle: NullableHandle) -> Resource
fn from(handle: NullableHandle) -> Resource
Source§impl<T> From<NullableHandle> for ServerEnd<T>
impl<T> From<NullableHandle> for ServerEnd<T>
Source§fn from(handle: NullableHandle) -> ServerEnd<T>
fn from(handle: NullableHandle) -> ServerEnd<T>
Source§impl From<NullableHandle> for Socket
impl From<NullableHandle> for Socket
Source§fn from(handle: NullableHandle) -> Socket
fn from(handle: NullableHandle) -> Socket
Source§impl From<NullableHandle> for Stream
impl From<NullableHandle> for Stream
Source§impl From<NullableHandle> for SuspendToken
impl From<NullableHandle> for SuspendToken
Source§fn from(handle: NullableHandle) -> SuspendToken
fn from(handle: NullableHandle) -> SuspendToken
Source§impl From<NullableHandle> for Thread
impl From<NullableHandle> for Thread
Source§fn from(handle: NullableHandle) -> Thread
fn from(handle: NullableHandle) -> Thread
Source§impl<T> From<NullableHandle> for Timer<T>where
T: Timeline,
impl<T> From<NullableHandle> for Timer<T>where
T: Timeline,
Source§fn from(handle: NullableHandle) -> Timer<T>
fn from(handle: NullableHandle) -> Timer<T>
Source§impl From<NullableHandle> for Vcpu
impl From<NullableHandle> for Vcpu
Source§fn from(handle: NullableHandle) -> Vcpu
fn from(handle: NullableHandle) -> Vcpu
Source§impl From<NullableHandle> for Vmar
impl From<NullableHandle> for Vmar
Source§fn from(handle: NullableHandle) -> Vmar
fn from(handle: NullableHandle) -> Vmar
Source§impl From<NullableHandle> for Vmo
impl From<NullableHandle> for Vmo
Source§fn from(handle: NullableHandle) -> Vmo
fn from(handle: NullableHandle) -> Vmo
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<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<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<T> From<ServerEnd<T>> for NullableHandle
impl<T> From<ServerEnd<T>> for NullableHandle
Source§fn from(server: ServerEnd<T>) -> NullableHandle
fn from(server: ServerEnd<T>) -> 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 HandleBased for NullableHandle
impl HandleBased for NullableHandle
Source§fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
fn duplicate_handle(&self, rights: Rights) -> Result<Self, Status>
Source§fn replace_handle(self, rights: Rights) -> Result<Self, Status>
fn replace_handle(self, rights: Rights) -> Result<Self, Status>
Source§fn into_handle(self) -> NullableHandle
fn into_handle(self) -> NullableHandle
Source§fn from_handle(handle: NullableHandle) -> Self
fn from_handle(handle: NullableHandle) -> Self
Source§fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
fn into_handle_based<H>(self) -> Hwhere
H: HandleBased,
Source§fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn from_handle_based<H>(h: H) -> Selfwhere
H: HandleBased,
fn is_invalid_handle(&self) -> bool
Source§impl HandleFor<DefaultFuchsiaResourceDialect> for NullableHandle
impl HandleFor<DefaultFuchsiaResourceDialect> for NullableHandle
Source§type HandleInfo = HandleInfo
type HandleInfo = HandleInfo
Source§fn invalid() -> NullableHandle
fn invalid() -> NullableHandle
Handle used as a place filler when
we remove handles from an array.