Struct wayland_client::Proxy

source ·
pub struct Proxy<I: Interface> { /* private fields */ }
Expand description

An handle to a wayland proxy

This represents a wayland object instantiated in your client session. Several handles to the same object can exist at a given time, and cloning them won’t create a new protocol object, only clone the handle. The lifetime of the protocol object is not tied to the lifetime of these handles, but rather to sending or receiving destroying messages.

These handles are notably used to send requests to the server. To do you need to import the associated RequestsTrait trait from the module of this interface.

Implementations

Send a request through this object

Warning: This method is mostly intended to be used by code generated by wayland-scanner, and you should probably never need to use it directly, but rather use the appropriate RequestsTrait for your proxy.

This is the generic method to send requests.

If your request needs to create an object, use send_constructor.

Send a request creating an object through this object

Warning: This method is mostly intended to be used by code generated by wayland-scanner, and you should probably never need to use it directly, but rather use the appropriate RequestsTrait for your proxy.

This is the generic method to send requests that create objects

The slot in the message corresponding with the newly created object must have been filled by a placeholder object (see child_placeholder).

Check if the object associated with this proxy is still alive

Will return false if the object has been destroyed.

If the object is not managed by this library, this will always returns true.

Retrieve the interface version of this wayland object instance

Returns 0 on dead objects

Retrieve the object id of this wayland object

Access the arbitrary payload associated to this object

You need to specify the expected type of this payload, and this function will return None if either the types don’t match or you are attempting to access a non Send + Sync user data from the wrong thread.

This value is associated to the Proxy when you implement it, and you cannot access it mutably afterwards. If you need interior mutability, you are responsible for using a Mutex or similar type to achieve it.

Check if the other proxy refers to the same underlying wayland object

Create a new child object

Warning: This method is mostly intended to be used by code generated by wayland-scanner, and you should probably never need to use it directly, but rather use the appropriate RequestsTrait for your proxy.

This creates a new wayland object, considered as a child of this object. It will notably inherit its interface version.

The created object should immediately be implemented and sent in a request to the server, to keep the object list properly synchronized. Failure to do so will likely cause a protocol error.

Creates a handle of this proxy with its actual type erased

Create a wrapper for this object for queue management

As assigning a proxy to an event queue can be a racy operation in contexts involving multiple thread, this provides a facility to do this safely.

The wrapper object created behaves like a regular Proxy, except that all objects created as the result of its requests will be assigned to the queue associated to the provided token, rather than the queue of their parent. This does not change the queue of the proxy itself.

Create a placeholder object, to be used with send_constructor

Warning: This method is mostly intended to be used by code generated by wayland-scanner, and you should probably never need to use it directly, but rather use the appropriate RequestsTrait for your proxy.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
destroy a buffer Read more
create new surface Read more
create new region Read more
start drag-and-drop operation Read more
copy data to the selection Read more
destroy data device Read more
create a new data source Read more
create a new data device Read more
accept one of the offered mime types Read more
request that the data is transferred Read more
destroy data offer Read more
the offer will no longer be used Read more
set the available/preferred drag-and-drop actions Read more
add an offered mime type Read more
destroy the data source Read more
set the available drag-and-drop actions Read more
asynchronous roundtrip Read more
get global registry object Read more
release the keyboard object Read more
release the output object Read more
set the pointer surface Read more
release the pointer object Read more
destroy region Read more
add rectangle to region Read more
subtract rectangle from region Read more
bind an object to the display Read more
return pointer object Read more
return keyboard object Read more
return touch object Read more
release the seat object Read more
create a shell surface from a surface Read more
respond to a ping event Read more
start an interactive move Read more
start an interactive resize Read more
make the surface a toplevel surface Read more
make the surface a transient surface Read more
make the surface a fullscreen surface Read more
make the surface a popup surface Read more
make the surface a maximized surface Read more
set surface title Read more
set surface class Read more
create a shm pool Read more
create a buffer from the pool Read more
destroy the pool Read more
change the size of the pool mapping Read more
unbind from the subcompositor interface Read more
give a surface the role sub-surface Read more
remove sub-surface interface Read more
reposition the sub-surface Read more
restack the sub-surface Read more
restack the sub-surface Read more
set sub-surface to synchronized mode Read more
set sub-surface to desynchronized mode Read more
delete surface Read more
set the surface contents Read more
mark part of the surface damaged Read more
request a frame throttling hint Read more
set opaque region Read more
set input region Read more
commit pending surface state Read more
sets the buffer transformation Read more
sets the buffer scaling factor Read more
mark part of the surface damaged using buffer coordinates Read more
release the touch object Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Convert 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 more
Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more
Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more
Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more
Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.