Struct wayland_commons::map::Object

source ·
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§

source§

impl<Meta: ObjectMetadata> Object<Meta>

source

pub fn from_interface<I: Interface>(version: u32, meta: Meta) -> Object<Meta>

Create an Object corresponding to given interface and version

source

pub fn event_child(&self, opcode: u16) -> Option<Object<Meta>>

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

source

pub fn request_child(&self, opcode: u16) -> Option<Object<Meta>>

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

source

pub fn is_interface<I: Interface>(&self) -> bool

Check whether this object is of given interface

source

pub fn placeholder(meta: Meta) -> Object<Meta>

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

Trait Implementations§

source§

impl<Meta: Clone + ObjectMetadata> Clone for Object<Meta>

source§

fn clone(&self) -> Object<Meta>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Meta: ObjectMetadata + Debug> Debug for Object<Meta>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Meta> RefUnwindSafe for Object<Meta>where Meta: RefUnwindSafe,

§

impl<Meta> Send for Object<Meta>where Meta: Send,

§

impl<Meta> Sync for Object<Meta>where Meta: Sync,

§

impl<Meta> Unpin for Object<Meta>where Meta: Unpin,

§

impl<Meta> UnwindSafe for Object<Meta>where Meta: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.