GlobalMapper

Struct GlobalMapper 

Source
pub struct GlobalMapper { /* private fields */ }
Expand description

A filter for globals advertised via wl_registry.

This type allows filtering globals sent by the server and advertising synthetic globals that are handled by the proxy.

Implementations§

Source§

impl GlobalMapper

Source

pub fn add_synthetic_global( &mut self, registry: &WlRegistry, interface: ObjectInterface, version: u32, ) -> u32

Announces a synthetic global and returns the global name.

This function is similar to GlobalMapper::try_add_synthetic_global but logs a message instead of returning an error if the global could not be sent to the client.

Source

pub fn try_add_synthetic_global( &mut self, registry: &WlRegistry, interface: ObjectInterface, version: u32, ) -> Result<u32, ObjectError>

Tries to announce a synthetic global and returns the global name.

Source

pub fn remove_synthetic_global(&mut self, registry: &WlRegistry, name: u32)

Removes a synthetic global.

This function is similar to GlobalMapper::try_remove_synthetic_global but logs a message instead of returning an error if the global_remove event could not be sent to the client.

Source

pub fn try_remove_synthetic_global( &mut self, registry: &WlRegistry, name: u32, ) -> Result<(), ObjectError>

Tries to remove a synthetic global.

Source

pub fn forward_global( &mut self, registry: &WlRegistry, server_name: u32, interface: ObjectInterface, version: u32, )

Handles a server-sent global event.

This function is similar to GlobalMapper::try_forward_global but logs a message instead of returning an error if the global could not be sent to the client.

Source

pub fn try_forward_global( &mut self, registry: &WlRegistry, server_name: u32, interface: ObjectInterface, version: u32, ) -> Result<(), ObjectError>

Tries to handle a server-sent global event.

Source

pub fn ignore_global(&mut self, name: u32)

Ignores a server-sent global.

This function should be used so that global_remove events can be filtered properly.

Source

pub fn forward_global_remove(&mut self, registry: &WlRegistry, server_name: u32)

Handles a server-sent global_remove event.

This function is similar to GlobalMapper::try_forward_global_remove but logs a message instead of returning an error if the event could not be sent to the client.

Source

pub fn try_forward_global_remove( &mut self, registry: &WlRegistry, server_name: u32, ) -> Result<(), ObjectError>

Tries to handle a server-sent global_remove event.

Source

pub fn forward_bind( &mut self, registry: &WlRegistry, client_name: u32, object: &Rc<dyn Object>, )

Handles a client-sent bind request.

This function is similar to GlobalMapper::try_forward_bind but logs a message instead of returning an error if the request could not be forwarded to the server.

Source

pub fn try_forward_bind( &mut self, registry: &WlRegistry, client_name: u32, object: &Rc<dyn Object>, ) -> Result<(), ObjectError>

Tries to handle a client-sent bind request.

Trait Implementations§

Source§

impl Default for GlobalMapper

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.