Struct wayland_server::Client
source · pub struct Client { /* private fields */ }
Expand description
A handle to a client connected to your server
There can be several handles referring to the same client
Implementations
sourceimpl Client
impl Client
sourcepub fn equals(&self, other: &Client) -> bool
pub fn equals(&self, other: &Client) -> bool
Check whether this client handle refers to the same client as an other
sourcepub fn data_map(&self) -> &UserDataMap
pub fn data_map(&self) -> &UserDataMap
Access the map handling user data associated to this client
See UserDataMap
documentation for details about its use.
sourcepub fn add_destructor<F: FnOnce(&UserDataMap) + Send + 'static>(
&self,
destructor: F
)
pub fn add_destructor<F: FnOnce(&UserDataMap) + Send + 'static>(
&self,
destructor: F
)
Add a destructor for this client
This closure will be called when the client disconnects or is killed, It has access to the user data map associated to this client.
You can add several destructors which will all be called sequentially. Note that if you accidentally add two copies of the same closure, it’ll be called twice.
The destructors will be executed on the thread containing the wayland event loop.
sourcepub fn create_resource<I: Interface>(
&self,
version: u32
) -> Option<NewResource<I>>
pub fn create_resource<I: Interface>(
&self,
version: u32
) -> Option<NewResource<I>>
Create a new resource for this client
To ensure the state coherence between client and server, this resource should immediately be implemented and sent to the client through and appropriate event. Failure to do so will likely cause protocol errors.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more