Object

Trait Object 

Source
pub trait Object: Debug + ObjectPrivate {
    // Required methods
    fn core(&self) -> &ObjectCore;
    fn unset_handler(&self);
    fn get_handler_any_ref(
        &self,
    ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>;
    fn get_handler_any_mut(
        &self,
    ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>;
}
Expand description

A wayland object.

Note that ObjectCoreApi provides additional functions for all T: Object.

Required Methods§

Source

fn core(&self) -> &ObjectCore

Returns the ObjectCore of this object.

Source

fn unset_handler(&self)

Unsets the handler of this object.

Handlers are unset automatically when the State is destroyed. Otherwise, if a handler creates a reference cycle, the handler has to be unset manually. For example, within the handler of a destructor message or when the client disconnects.

Source

fn get_handler_any_ref( &self, ) -> Result<HandlerRef<'_, dyn Any>, HandlerAccessError>

Returns a shared reference to the handler.

Source

fn get_handler_any_mut( &self, ) -> Result<HandlerMut<'_, dyn Any>, HandlerAccessError>

Returns a mutable reference to the handler.

Implementors§