pub struct Object<Meta: ObjectMetadata> {
    pub interface: &'static str,
    pub version: u32,
    pub requests: &'static [MessageDesc],
    pub events: &'static [MessageDesc],
    pub meta: Meta,
    pub childs_from_events: fn(_: u16, _: u32, _: &Meta) -> Option<Object<Meta>>,
    pub childs_from_requests: fn(_: u16, _: u32, _: &Meta) -> Option<Object<Meta>>,
}
Expand description

The representation of a protocol object

Fields

interface: &'static str

Interface name of this object

version: u32

Version of this object

requests: &'static [MessageDesc]

Description of the requests of this object

events: &'static [MessageDesc]

Description of the events of this object

meta: Meta

Metadata associated to this object (ex: its event queue client side)

childs_from_events: fn(_: u16, _: u32, _: &Meta) -> Option<Object<Meta>>

A function which, from an opcode, a version, and the Meta, creates a child object associated with this event if any

childs_from_requests: fn(_: u16, _: u32, _: &Meta) -> Option<Object<Meta>>

A function which, from an opcode, a version, and the Meta, creates a child object associated with this request if any

Implementations

Create an Object corresponding to given interface and version

Create an optional Object corresponding to the possible new_id associated with given event opcode

Create an optional Object corresponding to the possible new_id associated with given request opcode

Check whether this object is of given interface

Create a placeholder object that will be filled-in by the message logic

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.