fidl::handle::fuchsia_handles

Trait AsHandleRef

Source
pub trait AsHandleRef {
    // Required method
    fn as_handle_ref(&self) -> Unowned<'_, Handle>;

    // Provided methods
    fn raw_handle(&self) -> u32 { ... }
    fn signal_handle(
        &self,
        clear_mask: Signals,
        set_mask: Signals,
    ) -> Result<(), Status> { ... }
    fn wait_handle(
        &self,
        signals: Signals,
        deadline: Instant<MonotonicTimeline>,
    ) -> Result<Signals, Status> { ... }
    fn wait_async_handle(
        &self,
        port: &Port,
        key: u64,
        signals: Signals,
        options: WaitAsyncOpts,
    ) -> Result<(), Status> { ... }
    fn get_name(&self) -> Result<Name, Status> { ... }
    fn set_name(&self, name: &Name) -> Result<(), Status> { ... }
    fn basic_info(&self) -> Result<HandleBasicInfo, Status> { ... }
    fn count_info(&self) -> Result<HandleCountInfo, Status> { ... }
    fn get_koid(&self) -> Result<Koid, Status> { ... }
}
Expand description

A trait to get a reference to the underlying handle of an object.

Required Methods§

Source

fn as_handle_ref(&self) -> Unowned<'_, Handle>

Get a reference to the handle. One important use of such a reference is for object_wait_many.

Provided Methods§

Source

fn raw_handle(&self) -> u32

Interpret the reference as a raw handle (an integer type). Two distinct handles will have different raw values (so it can perhaps be used as a key in a data structure).

Source

fn signal_handle( &self, clear_mask: Signals, set_mask: Signals, ) -> Result<(), Status>

Set and clear userspace-accessible signal bits on an object. Wraps the zx_object_signal syscall.

Source

fn wait_handle( &self, signals: Signals, deadline: Instant<MonotonicTimeline>, ) -> Result<Signals, Status>

Waits on a handle. Wraps the zx_object_wait_one syscall.

Source

fn wait_async_handle( &self, port: &Port, key: u64, signals: Signals, options: WaitAsyncOpts, ) -> Result<(), Status>

Causes packet delivery on the given port when the object changes state and matches signals. zx_object_wait_async syscall.

Source

fn get_name(&self) -> Result<Name, Status>

Get the Property::NAME property for this object.

Wraps a call to the zx_object_get_property syscall for the ZX_PROP_NAME property.

Source

fn set_name(&self, name: &Name) -> Result<(), Status>

Set the Property::NAME property for this object.

The name’s length must be less than sys::ZX_MAX_NAME_LEN, i.e. name.to_bytes_with_nul().len() <= sys::ZX_MAX_NAME_LEN, or Err(Status::INVALID_ARGS) will be returned.

Wraps a call to the zx_object_get_property syscall for the ZX_PROP_NAME property.

Source

fn basic_info(&self) -> Result<HandleBasicInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_BASIC topic.

Source

fn count_info(&self) -> Result<HandleCountInfo, Status>

Wraps the zx_object_get_info syscall for the ZX_INFO_HANDLE_COUNT topic.

Source

fn get_koid(&self) -> Result<Koid, Status>

Returns the koid (kernel object ID) for this handle.

Implementations on Foreign Types§

§

impl<H> AsHandleRef for OnSignals<'_, H>
where H: AsHandleRef,

§

fn as_handle_ref(&self) -> Unowned<'_, Handle>

§

impl<R, W> AsHandleRef for Fifo<R, W>

§

fn as_handle_ref(&self) -> Unowned<'_, Handle>

Source§

impl<T> AsHandleRef for &T
where T: AsHandleRef,

Implementors§

Source§

impl AsHandleRef for zx::bti::Bti

Source§

impl AsHandleRef for zx::exception::Exception

Source§

impl AsHandleRef for zx::iommu::Iommu

Source§

impl AsHandleRef for zx::pager::Pager

Source§

impl AsHandleRef for zx::pmt::Pmt

§

impl AsHandleRef for fidl::handle::AsyncChannel

§

impl AsHandleRef for fidl::handle::AsyncSocket

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Bti

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Channel

Source§

impl AsHandleRef for DebugLog

Source§

impl AsHandleRef for Event

Source§

impl AsHandleRef for EventPair

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Exception

Source§

impl AsHandleRef for Guest

Source§

impl AsHandleRef for Handle

Source§

impl AsHandleRef for Interrupt

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Iommu

Source§

impl AsHandleRef for Job

Source§

impl AsHandleRef for Msi

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Pager

Source§

impl AsHandleRef for PciDevice

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Pmt

Source§

impl AsHandleRef for Port

Source§

impl AsHandleRef for Process

Source§

impl AsHandleRef for Profile

Source§

impl AsHandleRef for Resource

Source§

impl AsHandleRef for fidl::handle::fuchsia_handles::Socket

Source§

impl AsHandleRef for Stream

Source§

impl AsHandleRef for SuspendToken

Source§

impl AsHandleRef for Thread

Source§

impl AsHandleRef for Vcpu

Source§

impl AsHandleRef for Vmar

Source§

impl AsHandleRef for Vmo

Source§

impl<'a, T> AsHandleRef for Unowned<'a, T>
where T: HandleBased,

Source§

impl<R, W> AsHandleRef for fidl::handle::fuchsia_handles::Fifo<R, W>

Source§

impl<Reference, Output> AsHandleRef for Clock<Reference, Output>
where Reference: Timeline, Output: Timeline,

Source§

impl<T> AsHandleRef for ClientEnd<T>

Source§

impl<T> AsHandleRef for ServerEnd<T>

Source§

impl<T> AsHandleRef for Timer<T>
where T: Timeline,