Trait zircon_object::object::KernelObject[][src]

pub trait KernelObject: DowncastSync + Debug {
    fn id(&self) -> KoID;
fn type_name(&self) -> &str;
fn name(&self) -> String;
fn set_name(&self, name: &str);
fn signal(&self) -> Signal;
fn signal_set(&self, signal: Signal);
fn signal_clear(&self, signal: Signal);
fn signal_change(&self, clear: Signal, set: Signal);
fn add_signal_callback(&self, callback: SignalHandler); fn get_child(&self, _id: KoID) -> ZxResult<Arc<dyn KernelObject>> { ... }
fn peer(&self) -> ZxResult<Arc<dyn KernelObject>> { ... }
fn related_koid(&self) -> KoID { ... }
fn allowed_signals(&self) -> Signal { ... } }

Common interface of a kernel object.

Implemented by impl_kobject macro.

Required methods

fn id(&self) -> KoID[src]

Get object’s KoID.

fn type_name(&self) -> &str[src]

Get the name of the type of the kernel object.

fn name(&self) -> String[src]

Get object’s name.

fn set_name(&self, name: &str)[src]

Set object’s name.

fn signal(&self) -> Signal[src]

Get the signal status.

fn signal_set(&self, signal: Signal)[src]

Assert signal.

fn signal_clear(&self, signal: Signal)[src]

Deassert signal.

fn signal_change(&self, clear: Signal, set: Signal)[src]

Change signal status: first clear then set indicated bits.

All signal callbacks will be called.

fn add_signal_callback(&self, callback: SignalHandler)[src]

Add callback for signal status changes.

The callback is a function of Fn(Signal) -> bool. It returns a bool indicating whether the handle process is over. If true, the function will never be called again.

Loading content...

Provided methods

fn get_child(&self, _id: KoID) -> ZxResult<Arc<dyn KernelObject>>[src]

Attempt to find a child of the object with given KoID.

If the object is a Process, the Threads it contains may be obtained.

If the object is a Job, its (immediate) child Jobs and the Processes it contains may be obtained.

If the object is a Resource, its (immediate) child Resources may be obtained.

fn peer(&self) -> ZxResult<Arc<dyn KernelObject>>[src]

Attempt to get the object’s peer.

An object peer is the opposite endpoint of a Channel, Socket, Fifo, or EventPair.

fn related_koid(&self) -> KoID[src]

If the object is related to another (such as the other end of a channel, or the parent of a job), returns the KoID of that object, otherwise returns zero.

fn allowed_signals(&self) -> Signal[src]

Get object’s allowed signals.

Loading content...

Implementations

impl dyn KernelObject[src]

pub fn is<__T: KernelObject>(&self) -> bool[src]

Returns true if the trait object wraps an object of type __T.

pub fn downcast<__T: KernelObject>(
    self: Box<Self>
) -> Result<Box<__T>, Box<Self>>
[src]

Returns a boxed object from a boxed trait object if the underlying object is of type __T. Returns the original boxed trait if it isn’t.

pub fn downcast_rc<__T: KernelObject>(
    self: Rc<Self>
) -> Result<Rc<__T>, Rc<Self>>
[src]

Returns an Rc-ed object from an Rc-ed trait object if the underlying object is of type __T. Returns the original Rc-ed trait if it isn’t.

pub fn downcast_ref<__T: KernelObject>(&self) -> Option<&__T>[src]

Returns a reference to the object within the trait object if it is of type __T, or None if it isn’t.

pub fn downcast_mut<__T: KernelObject>(&mut self) -> Option<&mut __T>[src]

Returns a mutable reference to the object within the trait object if it is of type __T, or None if it isn’t.

pub fn downcast_arc<__T: KernelObject>(
    self: Arc<Self>
) -> Result<Arc<__T>, Arc<Self>> where
    __T: Any + Send + Sync
[src]

Returns an Arc-ed object from an Arc-ed trait object if the underlying object is of type __T. Returns the original Arc-ed trait if it isn’t.

impl dyn KernelObject[src]

pub fn wait_signal(
    self: &Arc<Self>,
    signal: Signal
) -> impl Future<Output = Signal>
[src]

Asynchronous wait for one of signal.

pub fn send_signal_to_port_async(
    self: &Arc<Self>,
    signal: Signal,
    port: &Arc<Port>,
    key: u64
)
[src]

Once one of the signal asserted, push a packet with key into the port,

It’s used to implement sys_object_wait_async.

Implementors

impl KernelObject for DebugLog[src]

impl KernelObject for BusTransactionInitiator[src]

impl KernelObject for Interrupt[src]

impl KernelObject for Iommu[src]

impl KernelObject for PcieDeviceKObject[src]

impl KernelObject for PinnedMemoryToken[src]

impl KernelObject for Resource[src]

impl KernelObject for Channel[src]

impl KernelObject for Fifo[src]

impl KernelObject for Socket[src]

impl KernelObject for DummyObject[src]

impl KernelObject for Event[src]

impl KernelObject for EventPair[src]

impl KernelObject for Futex[src]

impl KernelObject for Port[src]

impl KernelObject for Timer[src]

impl KernelObject for ExceptionObject[src]

impl KernelObject for Job[src]

impl KernelObject for Process[src]

impl KernelObject for SuspendToken[src]

impl KernelObject for Thread[src]

impl KernelObject for Stream[src]

impl KernelObject for VmAddressRegion[src]

impl KernelObject for VmObject[src]

Loading content...