wayland_commons

Trait Interface

Source
pub trait Interface: 'static {
    type Request: MessageGroup + 'static;
    type Event: MessageGroup + 'static;

    const NAME: &'static str;
    const VERSION: u32;

    // Required method
    fn c_interface() -> *const wl_interface;
}
Expand description

The description of a wayland interface

Implementations of this trait are supposed to be generated using the wayland-scanner crate.

Required Associated Constants§

Source

const NAME: &'static str

Name of this interface

Source

const VERSION: u32

Maximum supported version of this interface

This is the maximum version supported by the protocol specification currently used by this library, and should not be used as-is in your code, as a version change can subtly change the behavior of some objects.

Server are supposed to be able to handle all versions from 1 to the one they advertise through the registry, and clients can choose any version among the ones the server supports.

Required Associated Types§

Source

type Request: MessageGroup + 'static

Set of requests associated to this interface

Requests are messages from the client to the server

Source

type Event: MessageGroup + 'static

Set of events associated to this interface

Events are messages from the server to the client

Required Methods§

Source

fn c_interface() -> *const wl_interface

Pointer to the C representation of this interface

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§