Function fidl_driver::encoding::mixed_into_handle_info

source ·
pub unsafe fn mixed_into_handle_info(
    this: Option<MixedHandle>,
) -> Result<HandleInfo, Status>
Expand description

Converts the handle to a HandleInfo, with [DriverHandle]s being represented as a valid driver handle but ObjectType::NONE.

This uses Handle::basic_info to get the object type and rights for a zircon handle, so may return an error if that fails.

§Safety

The caller is responsible for making sure that the handle is either converted back to a MixedHandle or the correct cleanup happens, or an error or leak may happen when the HandleInfo is dropped.