[−][src]Struct wayland_client::Proxy
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 this
you need to convert them to the corresponding Rust object (using .into())
and use methods on the Rust object.
Methods
impl<I: Interface> Proxy<I>[src]
pub fn send(&self, msg: I::Request)[src]
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 methods on the Rust object.
This is the generic method to send requests.
If your request needs to create an object, use send_constructor.
pub fn send_constructor<J, F>(
&self,
msg: I::Request,
implementor: F,
version: Option<u32>
) -> Result<J, ()> where
J: Interface + From<Proxy<J>>,
F: FnOnce(NewProxy<J>) -> J, [src]
&self,
msg: I::Request,
implementor: F,
version: Option<u32>
) -> Result<J, ()> where
J: Interface + From<Proxy<J>>,
F: FnOnce(NewProxy<J>) -> J,
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 methods on the Rust object.
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).
pub fn is_alive(&self) -> bool[src]
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.
pub fn version(&self) -> u32[src]
Retrieve the interface version of this wayland object instance
Returns 0 on dead objects
pub fn id(&self) -> u32[src]
Retrieve the object id of this wayland object
pub fn user_data<UD: 'static>(&self) -> Option<&UD>[src]
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.
pub fn equals(&self, other: &Proxy<I>) -> bool[src]
Check if the other proxy refers to the same underlying wayland object
pub fn child<C: Interface>(&self) -> NewProxy<C>[src]
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 methods on the Rust object.
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.
pub fn anonymize(&self) -> Proxy<AnonymousObject>[src]
Creates a handle of this proxy with its actual type erased
pub fn make_wrapper(&self, queue: &QueueToken) -> Result<I, ()> where
I: From<Proxy<I>>, [src]
I: From<Proxy<I>>,
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.
pub fn child_placeholder<J: Interface + From<Proxy<J>>>(&self) -> J[src]
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 methods on the Rust object.
Trait Implementations
impl<I: Interface> Eq for Proxy<I>[src]
impl<I: Interface> Clone for Proxy<I>[src]
fn clone(&self) -> Proxy<I>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<I: Interface> PartialEq<Proxy<I>> for Proxy<I>[src]
fn eq(&self, other: &Proxy<I>) -> bool[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl AsRef<Proxy<WlDisplay>> for WlDisplay[src]
impl AsRef<Proxy<WlRegistry>> for WlRegistry[src]
impl AsRef<Proxy<WlCallback>> for WlCallback[src]
impl AsRef<Proxy<WlCompositor>> for WlCompositor[src]
impl AsRef<Proxy<WlShmPool>> for WlShmPool[src]
impl AsRef<Proxy<WlShm>> for WlShm[src]
impl AsRef<Proxy<WlBuffer>> for WlBuffer[src]
impl AsRef<Proxy<WlDataOffer>> for WlDataOffer[src]
impl AsRef<Proxy<WlDataSource>> for WlDataSource[src]
impl AsRef<Proxy<WlDataDevice>> for WlDataDevice[src]
impl AsRef<Proxy<WlDataDeviceManager>> for WlDataDeviceManager[src]
impl AsRef<Proxy<WlShell>> for WlShell[src]
impl AsRef<Proxy<WlShellSurface>> for WlShellSurface[src]
impl AsRef<Proxy<WlSurface>> for WlSurface[src]
impl AsRef<Proxy<WlSeat>> for WlSeat[src]
impl AsRef<Proxy<WlPointer>> for WlPointer[src]
impl AsRef<Proxy<WlKeyboard>> for WlKeyboard[src]
impl AsRef<Proxy<WlTouch>> for WlTouch[src]
impl AsRef<Proxy<WlOutput>> for WlOutput[src]
impl AsRef<Proxy<WlRegion>> for WlRegion[src]
impl AsRef<Proxy<WlSubcompositor>> for WlSubcompositor[src]
impl AsRef<Proxy<WlSubsurface>> for WlSubsurface[src]
impl AsRef<Proxy<AnonymousObject>> for AnonymousObject[src]
impl From<Proxy<WlDisplay>> for WlDisplay[src]
impl From<WlDisplay> for Proxy<WlDisplay>[src]
impl From<Proxy<WlRegistry>> for WlRegistry[src]
impl From<WlRegistry> for Proxy<WlRegistry>[src]
fn from(value: WlRegistry) -> Self[src]
impl From<Proxy<WlCallback>> for WlCallback[src]
impl From<WlCallback> for Proxy<WlCallback>[src]
fn from(value: WlCallback) -> Self[src]
impl From<Proxy<WlCompositor>> for WlCompositor[src]
impl From<WlCompositor> for Proxy<WlCompositor>[src]
fn from(value: WlCompositor) -> Self[src]
impl From<Proxy<WlShmPool>> for WlShmPool[src]
impl From<WlShmPool> for Proxy<WlShmPool>[src]
impl From<Proxy<WlShm>> for WlShm[src]
impl From<WlShm> for Proxy<WlShm>[src]
impl From<Proxy<WlBuffer>> for WlBuffer[src]
impl From<WlBuffer> for Proxy<WlBuffer>[src]
impl From<Proxy<WlDataOffer>> for WlDataOffer[src]
impl From<WlDataOffer> for Proxy<WlDataOffer>[src]
fn from(value: WlDataOffer) -> Self[src]
impl From<Proxy<WlDataSource>> for WlDataSource[src]
impl From<WlDataSource> for Proxy<WlDataSource>[src]
fn from(value: WlDataSource) -> Self[src]
impl From<Proxy<WlDataDevice>> for WlDataDevice[src]
impl From<WlDataDevice> for Proxy<WlDataDevice>[src]
fn from(value: WlDataDevice) -> Self[src]
impl From<Proxy<WlDataDeviceManager>> for WlDataDeviceManager[src]
impl From<WlDataDeviceManager> for Proxy<WlDataDeviceManager>[src]
fn from(value: WlDataDeviceManager) -> Self[src]
impl From<Proxy<WlShell>> for WlShell[src]
impl From<WlShell> for Proxy<WlShell>[src]
impl From<Proxy<WlShellSurface>> for WlShellSurface[src]
impl From<WlShellSurface> for Proxy<WlShellSurface>[src]
fn from(value: WlShellSurface) -> Self[src]
impl From<Proxy<WlSurface>> for WlSurface[src]
impl From<WlSurface> for Proxy<WlSurface>[src]
impl From<Proxy<WlSeat>> for WlSeat[src]
impl From<WlSeat> for Proxy<WlSeat>[src]
impl From<Proxy<WlPointer>> for WlPointer[src]
impl From<WlPointer> for Proxy<WlPointer>[src]
impl From<Proxy<WlKeyboard>> for WlKeyboard[src]
impl From<WlKeyboard> for Proxy<WlKeyboard>[src]
fn from(value: WlKeyboard) -> Self[src]
impl From<Proxy<WlTouch>> for WlTouch[src]
impl From<WlTouch> for Proxy<WlTouch>[src]
impl From<Proxy<WlOutput>> for WlOutput[src]
impl From<WlOutput> for Proxy<WlOutput>[src]
impl From<Proxy<WlRegion>> for WlRegion[src]
impl From<WlRegion> for Proxy<WlRegion>[src]
impl From<Proxy<WlSubcompositor>> for WlSubcompositor[src]
impl From<WlSubcompositor> for Proxy<WlSubcompositor>[src]
fn from(value: WlSubcompositor) -> Self[src]
impl From<Proxy<WlSubsurface>> for WlSubsurface[src]
impl From<WlSubsurface> for Proxy<WlSubsurface>[src]
fn from(value: WlSubsurface) -> Self[src]
impl From<Proxy<AnonymousObject>> for AnonymousObject[src]
impl From<AnonymousObject> for Proxy<AnonymousObject>[src]
fn from(value: AnonymousObject) -> Self[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Downcast for T where
T: Any, [src]
T: Any,