Trait wayland_client::Proxy
source · [−]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 from_id(
conn: &mut ConnectionHandle<'_>,
id: ObjectId
) -> Result<Self, InvalidId>;
fn parse_event(
conn: &mut ConnectionHandle<'_>,
msg: Message<ObjectId>
) -> Result<(Self, Self::Event), DispatchError>;
fn write_request(
&self,
conn: &mut ConnectionHandle<'_>,
req: Self::Request
) -> Result<Message<ObjectId>, InvalidId>;
}
Expand description
Trait representing a Wayland interface
Associated Types
Required methods
Access the user-data 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.
fn parse_event(
conn: &mut ConnectionHandle<'_>,
msg: Message<ObjectId>
) -> Result<(Self, Self::Event), DispatchError>
fn parse_event(
conn: &mut ConnectionHandle<'_>,
msg: Message<ObjectId>
) -> Result<(Self, Self::Event), DispatchError>
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.
fn write_request(
&self,
conn: &mut ConnectionHandle<'_>,
req: Self::Request
) -> Result<Message<ObjectId>, InvalidId>
fn write_request(
&self,
conn: &mut ConnectionHandle<'_>,
req: Self::Request
) -> Result<Message<ObjectId>, InvalidId>
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.