Struct fdf::MixedHandle

source ·
#[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

source

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.

source

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.

source

pub fn from_zircon_handle(handle: ZirconHandle) -> Option<Self>

Makes a MixedHandle from an existing ZirconHandle. Returns None if the handle is invalid.

source

pub fn is_driver(&self) -> bool

Evaluates whether the contained handle is a driver handle or not

source

pub fn resolve(self) -> MixedHandleType<DriverHandle, ZirconHandle>

Resolves the handle to the appropriate real handle type

source

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

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for MixedHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<T> From<Channel<T>> for MixedHandle

source§

fn from(value: Channel<T>) -> Self

Converts to this type from the input type.
source§

impl From<DriverHandle> for MixedHandle

source§

fn from(value: DriverHandle) -> Self

Converts to this type from the input type.
source§

impl From<MixedHandle> for MixedHandleType<DriverHandle, ZirconHandle>

source§

fn from(value: MixedHandle) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.