#[repr(C)]pub struct MixedHandle(/* private fields */);
Expand description
A handle that might be either a DriverHandle
or a ZirconHandle
, depending on its
bit pattern.
Implementations§
Source§impl MixedHandle
impl MixedHandle
Sourcepub unsafe fn from_raw(handle: NonZero<fdf_handle_t>) -> Self
pub unsafe fn from_raw(handle: NonZero<fdf_handle_t>) -> Self
Makes a MixedHandle
from an existing raw handle.
§Safety
The handle must be valid and unowned, as this will take ownership of the handle and drop it when this object drops.
Sourcepub unsafe fn try_from_raw(handle: fdf_handle_t) -> Option<Self>
pub unsafe fn try_from_raw(handle: fdf_handle_t) -> Option<Self>
Makes a MixedHandle
from an existing raw handle that might be
zeroed (invalid).
§Safety
The handle must be valid and unowned, as this will take ownership of the handle and drop it when this object drops.
Sourcepub fn from_zircon_handle(handle: ZirconHandle) -> Option<Self>
pub fn from_zircon_handle(handle: ZirconHandle) -> Option<Self>
Makes a MixedHandle
from an existing ZirconHandle
. Returns
None
if the handle is invalid.
Sourcepub fn is_driver(&self) -> bool
pub fn is_driver(&self) -> bool
Evaluates whether the contained handle is a driver handle or not
Sourcepub fn resolve(self) -> MixedHandleType<DriverHandle, ZirconHandle>
pub fn resolve(self) -> MixedHandleType<DriverHandle, ZirconHandle>
Resolves the handle to the appropriate real handle type
Sourcepub fn resolve_ref(
&self,
) -> MixedHandleType<DriverHandleRef<'_>, ZirconHandleRef<'_>>
pub fn resolve_ref( &self, ) -> MixedHandleType<DriverHandleRef<'_>, ZirconHandleRef<'_>>
Resolves the handle to an appropriate real unowned handle type
Trait Implementations§
Source§impl Debug for MixedHandle
impl Debug for MixedHandle
Source§impl Drop for MixedHandle
impl Drop for MixedHandle
Source§impl<T> From<Channel<T>> for MixedHandle
impl<T> From<Channel<T>> for MixedHandle
Source§impl From<DriverHandle> for MixedHandle
impl From<DriverHandle> for MixedHandle
Source§fn from(value: DriverHandle) -> Self
fn from(value: DriverHandle) -> Self
Converts to this type from the input type.
Source§impl From<MixedHandle> for MixedHandleType<DriverHandle, ZirconHandle>
impl From<MixedHandle> for MixedHandleType<DriverHandle, ZirconHandle>
Source§fn from(value: MixedHandle) -> Self
fn from(value: MixedHandle) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for MixedHandle
impl RefUnwindSafe for MixedHandle
impl Send for MixedHandle
impl Sync for MixedHandle
impl Unpin for MixedHandle
impl UnwindSafe for MixedHandle
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
Mutably borrows from an owned value. Read more