[−][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
you need to import the associated RequestsTrait
trait from the module
of this interface.
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 RequestsTrait
for your proxy.
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<Proxy<J>, ()> where
J: Interface,
F: FnOnce(NewProxy<J>) -> Proxy<J>,
[src]
&self,
msg: I::Request,
implementor: F,
version: Option<u32>
) -> Result<Proxy<J>, ()> where
J: Interface,
F: FnOnce(NewProxy<J>) -> Proxy<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 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
).
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 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.
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<Proxy<I>, ()>
[src]
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>(&self) -> Proxy<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 RequestsTrait
for your proxy.
impl<I: Interface> Proxy<I>
[src]
pub fn is_external(&self) -> bool
[src]
Check whether this proxy is managed by the library or not
See from_c_ptr
for details.
pub fn c_ptr(&self) -> *mut wl_proxy
[src]
Get a raw pointer to the underlying wayland object
Retrieve a pointer to the object from the libwayland-client.so
library.
You will mostly need it to interface with C libraries needing access
to wayland objects (to initialize an opengl context for example).
pub unsafe fn from_c_ptr(ptr: *mut wl_proxy) -> Proxy<I>
[src]
Create a Proxy
instance from a C pointer
Create a Proxy
from a raw pointer to a wayland object from the
C library.
If the pointer was previously obtained by the c_ptr()
method, this
constructs a new proxy for the same object just like the clone()
method would have.
If the object was created by some other C library you are interfacing
with, it will be created in an "unmanaged" state: wayland-client will
treat it as foreign, and as such most of the safeties will be absent.
Notably the lifetime of the object can't be tracked, so the alive()
method will always return false
and you are responsible of not using
an object past its destruction (as this would cause a protocol error).
You will also be unable to associate any user data pointer to this object.
In order to handle protocol races, invoking it with a NULL pointer will create an already-dead object.
Trait Implementations
impl RequestsTrait for Proxy<WlDisplay>
[src]
fn sync<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
[src]
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
fn get_registry<F>(&self, implementor: F) -> Result<Proxy<WlRegistry>, ()> where
F: FnOnce(NewProxy<WlRegistry>) -> Proxy<WlRegistry>,
[src]
F: FnOnce(NewProxy<WlRegistry>) -> Proxy<WlRegistry>,
impl RequestsTrait for Proxy<WlRegistry>
[src]
fn bind<T: Interface, F>(
&self,
version: u32,
name: u32,
implementor: F
) -> Result<Proxy<T>, ()> where
F: FnOnce(NewProxy<T>) -> Proxy<T>,
[src]
&self,
version: u32,
name: u32,
implementor: F
) -> Result<Proxy<T>, ()> where
F: FnOnce(NewProxy<T>) -> Proxy<T>,
impl RequestsTrait for Proxy<WlCallback>
[src]
impl RequestsTrait for Proxy<WlCompositor>
[src]
fn create_surface<F>(&self, implementor: F) -> Result<Proxy<WlSurface>, ()> where
F: FnOnce(NewProxy<WlSurface>) -> Proxy<WlSurface>,
[src]
F: FnOnce(NewProxy<WlSurface>) -> Proxy<WlSurface>,
fn create_region<F>(&self, implementor: F) -> Result<Proxy<WlRegion>, ()> where
F: FnOnce(NewProxy<WlRegion>) -> Proxy<WlRegion>,
[src]
F: FnOnce(NewProxy<WlRegion>) -> Proxy<WlRegion>,
impl RequestsTrait for Proxy<WlShmPool>
[src]
fn create_buffer<F>(
&self,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format,
implementor: F
) -> Result<Proxy<WlBuffer>, ()> where
F: FnOnce(NewProxy<WlBuffer>) -> Proxy<WlBuffer>,
[src]
&self,
offset: i32,
width: i32,
height: i32,
stride: i32,
format: Format,
implementor: F
) -> Result<Proxy<WlBuffer>, ()> where
F: FnOnce(NewProxy<WlBuffer>) -> Proxy<WlBuffer>,
fn destroy(&self)
[src]
fn resize(&self, size: i32)
[src]
impl RequestsTrait for Proxy<WlShm>
[src]
fn create_pool<F>(
&self,
fd: RawFd,
size: i32,
implementor: F
) -> Result<Proxy<WlShmPool>, ()> where
F: FnOnce(NewProxy<WlShmPool>) -> Proxy<WlShmPool>,
[src]
&self,
fd: RawFd,
size: i32,
implementor: F
) -> Result<Proxy<WlShmPool>, ()> where
F: FnOnce(NewProxy<WlShmPool>) -> Proxy<WlShmPool>,
impl RequestsTrait for Proxy<WlBuffer>
[src]
impl RequestsTrait for Proxy<WlDataOffer>
[src]
fn accept(&self, serial: u32, mime_type: Option<String>)
[src]
fn receive(&self, mime_type: String, fd: RawFd)
[src]
fn destroy(&self)
[src]
fn finish(&self)
[src]
fn set_actions(&self, dnd_actions: u32, preferred_action: u32)
[src]
impl RequestsTrait for Proxy<WlDataSource>
[src]
fn offer(&self, mime_type: String)
[src]
fn destroy(&self)
[src]
fn set_actions(&self, dnd_actions: u32)
[src]
impl RequestsTrait for Proxy<WlDataDevice>
[src]
fn start_drag(
&self,
source: Option<&Proxy<WlDataSource>>,
origin: &Proxy<WlSurface>,
icon: Option<&Proxy<WlSurface>>,
serial: u32
)
[src]
&self,
source: Option<&Proxy<WlDataSource>>,
origin: &Proxy<WlSurface>,
icon: Option<&Proxy<WlSurface>>,
serial: u32
)
fn set_selection(&self, source: Option<&Proxy<WlDataSource>>, serial: u32)
[src]
fn release(&self)
[src]
impl RequestsTrait for Proxy<WlDataDeviceManager>
[src]
fn create_data_source<F>(
&self,
implementor: F
) -> Result<Proxy<WlDataSource>, ()> where
F: FnOnce(NewProxy<WlDataSource>) -> Proxy<WlDataSource>,
[src]
&self,
implementor: F
) -> Result<Proxy<WlDataSource>, ()> where
F: FnOnce(NewProxy<WlDataSource>) -> Proxy<WlDataSource>,
fn get_data_device<F>(
&self,
seat: &Proxy<WlSeat>,
implementor: F
) -> Result<Proxy<WlDataDevice>, ()> where
F: FnOnce(NewProxy<WlDataDevice>) -> Proxy<WlDataDevice>,
[src]
&self,
seat: &Proxy<WlSeat>,
implementor: F
) -> Result<Proxy<WlDataDevice>, ()> where
F: FnOnce(NewProxy<WlDataDevice>) -> Proxy<WlDataDevice>,
impl RequestsTrait for Proxy<WlShell>
[src]
fn get_shell_surface<F>(
&self,
surface: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlShellSurface>, ()> where
F: FnOnce(NewProxy<WlShellSurface>) -> Proxy<WlShellSurface>,
[src]
&self,
surface: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlShellSurface>, ()> where
F: FnOnce(NewProxy<WlShellSurface>) -> Proxy<WlShellSurface>,
impl RequestsTrait for Proxy<WlShellSurface>
[src]
fn pong(&self, serial: u32)
[src]
fn _move(&self, seat: &Proxy<WlSeat>, serial: u32)
[src]
fn resize(&self, seat: &Proxy<WlSeat>, serial: u32, edges: Resize)
[src]
fn set_toplevel(&self)
[src]
fn set_transient(
&self,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
[src]
&self,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
fn set_fullscreen(
&self,
method: FullscreenMethod,
framerate: u32,
output: Option<&Proxy<WlOutput>>
)
[src]
&self,
method: FullscreenMethod,
framerate: u32,
output: Option<&Proxy<WlOutput>>
)
fn set_popup(
&self,
seat: &Proxy<WlSeat>,
serial: u32,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
[src]
&self,
seat: &Proxy<WlSeat>,
serial: u32,
parent: &Proxy<WlSurface>,
x: i32,
y: i32,
flags: Transient
)
fn set_maximized(&self, output: Option<&Proxy<WlOutput>>)
[src]
fn set_title(&self, title: String)
[src]
fn set_class(&self, class_: String)
[src]
impl RequestsTrait for Proxy<WlSurface>
[src]
fn destroy(&self)
[src]
fn attach(&self, buffer: Option<&Proxy<WlBuffer>>, x: i32, y: i32)
[src]
fn damage(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn frame<F>(&self, implementor: F) -> Result<Proxy<WlCallback>, ()> where
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
[src]
F: FnOnce(NewProxy<WlCallback>) -> Proxy<WlCallback>,
fn set_opaque_region(&self, region: Option<&Proxy<WlRegion>>)
[src]
fn set_input_region(&self, region: Option<&Proxy<WlRegion>>)
[src]
fn commit(&self)
[src]
fn set_buffer_transform(&self, transform: Transform)
[src]
fn set_buffer_scale(&self, scale: i32)
[src]
fn damage_buffer(&self, x: i32, y: i32, width: i32, height: i32)
[src]
impl RequestsTrait for Proxy<WlSeat>
[src]
fn get_pointer<F>(&self, implementor: F) -> Result<Proxy<WlPointer>, ()> where
F: FnOnce(NewProxy<WlPointer>) -> Proxy<WlPointer>,
[src]
F: FnOnce(NewProxy<WlPointer>) -> Proxy<WlPointer>,
fn get_keyboard<F>(&self, implementor: F) -> Result<Proxy<WlKeyboard>, ()> where
F: FnOnce(NewProxy<WlKeyboard>) -> Proxy<WlKeyboard>,
[src]
F: FnOnce(NewProxy<WlKeyboard>) -> Proxy<WlKeyboard>,
fn get_touch<F>(&self, implementor: F) -> Result<Proxy<WlTouch>, ()> where
F: FnOnce(NewProxy<WlTouch>) -> Proxy<WlTouch>,
[src]
F: FnOnce(NewProxy<WlTouch>) -> Proxy<WlTouch>,
fn release(&self)
[src]
impl RequestsTrait for Proxy<WlPointer>
[src]
fn set_cursor(
&self,
serial: u32,
surface: Option<&Proxy<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32
)
[src]
&self,
serial: u32,
surface: Option<&Proxy<WlSurface>>,
hotspot_x: i32,
hotspot_y: i32
)
fn release(&self)
[src]
impl RequestsTrait for Proxy<WlKeyboard>
[src]
impl RequestsTrait for Proxy<WlTouch>
[src]
impl RequestsTrait for Proxy<WlOutput>
[src]
impl RequestsTrait for Proxy<WlRegion>
[src]
fn destroy(&self)
[src]
fn add(&self, x: i32, y: i32, width: i32, height: i32)
[src]
fn subtract(&self, x: i32, y: i32, width: i32, height: i32)
[src]
impl RequestsTrait for Proxy<WlSubcompositor>
[src]
fn destroy(&self)
[src]
fn get_subsurface<F>(
&self,
surface: &Proxy<WlSurface>,
parent: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlSubsurface>, ()> where
F: FnOnce(NewProxy<WlSubsurface>) -> Proxy<WlSubsurface>,
[src]
&self,
surface: &Proxy<WlSurface>,
parent: &Proxy<WlSurface>,
implementor: F
) -> Result<Proxy<WlSubsurface>, ()> where
F: FnOnce(NewProxy<WlSubsurface>) -> Proxy<WlSubsurface>,
impl RequestsTrait for Proxy<WlSubsurface>
[src]
fn destroy(&self)
[src]
fn set_position(&self, x: i32, y: i32)
[src]
fn place_above(&self, sibling: &Proxy<WlSurface>)
[src]
fn place_below(&self, sibling: &Proxy<WlSurface>)
[src]
fn set_sync(&self)
[src]
fn set_desync(&self)
[src]
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]
Auto Trait Implementations
impl<I> Unpin for Proxy<I>
impl<I> Sync for Proxy<I> where
I: Sync,
I: Sync,
impl<I> Send for Proxy<I> where
I: Sync,
I: Sync,
impl<I> !UnwindSafe for Proxy<I>
impl<I> !RefUnwindSafe for Proxy<I>
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,