pub unsafe trait EventHandler {
const WL_INTERFACE: &'static wl_interface;
// Required method
unsafe fn handle_event(
&self,
queue: &Queue,
data: *mut u8,
slf: &UntypedBorrowedProxy,
opcode: u32,
args: *mut wl_argument,
);
// Provided method
fn mutable_type() -> Option<(TypeId, &'static str)> { ... }
}Expand description
An event handler that can handle raw libwayland events.
§Safety
WL_INTERFACEmust be a valid wl_interface.mutable_typemust always return the same value.
Required Associated Constants§
Sourceconst WL_INTERFACE: &'static wl_interface
const WL_INTERFACE: &'static wl_interface
The type of interface that can be handled by this event handler.
Required Methods§
Sourceunsafe fn handle_event(
&self,
queue: &Queue,
data: *mut u8,
slf: &UntypedBorrowedProxy,
opcode: u32,
args: *mut wl_argument,
)
unsafe fn handle_event( &self, queue: &Queue, data: *mut u8, slf: &UntypedBorrowedProxy, opcode: u32, args: *mut wl_argument, )
Dispatches a raw libwayland event.
§Safety
slfmust have an interface compatible withWL_INTERFACE.opcodeandargsmust conform to an event ofWL_INTERFACE.- Any objects contained in
argsmust remain valid for the duration of the call. - If
Self::mutable_datareturnsSome, thendatamust be&mut TwhereThas the type ID returned bymutable_data.
Provided Methods§
Sourcefn mutable_type() -> Option<(TypeId, &'static str)>
fn mutable_type() -> Option<(TypeId, &'static str)>
Returns the mutable data type required by this event handler.
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.