pub trait Proxy: Sized {
    type Event;
    type Request;

    fn interface() -> &'static Interface;
    fn id(&self) -> ObjectId;
    fn version(&self) -> u32;
    fn data<U: Send + Sync + 'static>(&self) -> Option<&U>;
    fn object_data(&self) -> Option<&Arc<dyn ObjectData>>;
    fn backend(&self) -> &WeakBackend;
    fn from_id(conn: &Connection, id: ObjectId) -> Result<Self, InvalidId>;
    fn send_request(&self, req: Self::Request) -> Result<(), InvalidId>;
    fn send_constructor<I: Proxy>(
        &self,
        req: Self::Request,
        data: Arc<dyn ObjectData>
    ) -> Result<I, InvalidId>; fn parse_event(
        conn: &Connection,
        msg: Message<ObjectId>
    ) -> Result<(Self, Self::Event), DispatchError>; fn write_request(
        &self,
        conn: &Connection,
        req: Self::Request
    ) -> Result<(Message<ObjectId>, Option<(&'static Interface, u32)>), InvalidId>; }
Expand description

Trait representing a Wayland interface

Required Associated Types

The event enum for this interface

The request enum for this interface

Required Methods

The interface description

he ID of this object

The version of this object

Access the user-data associated with this object

Access the raw data associated with this object.

For objects created using the scanner-generated methods, this will be an instance of the QueueProxyData type.

Access the backend associated with this object

Create an object proxy from its ID

Returns an error this the provided object ID does not correspond to the Self interface.

Note: This method is mostly meant as an implementation detail to be used by code generated by wayland-scanner.

Send a request for this object.

It is an error to use this function on requests that create objects; use Proxy::send_constructor for such requests.

Send a request for this object that creates another object.

It is an error to use this function on requests that do not create objects; use Proxy::send_request for such requests.

Parse a event for this object

Note: This method is mostly meant as an implementation detail to be used by code generated by wayland-scanner.

Serialize a request for this object

Note: This method is mostly meant as an implementation detail to be used by code generated by wayland-scanner.

Implementors