[−][src]Struct wayland_client::NewProxy
A newly-created proxy that needs implementation
Whenever a new wayland object is created, you will
receive it as a NewProxy
. You then have to provide an
implementation for it, in order to process the incoming
events it may receive. Once this done you will be able
to use it as a regular Rust object.
Implementations are structs implementing the appropriate
variant of the Implementation
trait. They can also be
closures.
Methods
impl<I: Interface + 'static> NewProxy<I>
[src]
pub fn implement<T, UD>(self, handler: T, user_data: UD) -> I where
T: 'static,
UD: 'static,
I: HandledBy<T> + From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
T: 'static,
UD: 'static,
I: HandledBy<T> + From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
Implement this proxy using the given handler and implementation data.
The handler must be a struct implementing the EventHandler
trait of the I
interface.
This must be called from the same thread as the one owning the event queue this new proxy is attached to and will panic otherwise. A proxy by default inherits the event queue of its parent object.
If you don't want an object to inherits its parent queue, see Proxy::make_wrapper
pub fn implement_closure<F, UD>(self, implementation: F, user_data: UD) -> I where
F: FnMut(I::Event, I) + 'static,
UD: 'static,
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
F: FnMut(I::Event, I) + 'static,
UD: 'static,
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
Implement this proxy using the given implementation closure and implementation data.
This must be called from the same thread as the one owning the event queue this new proxy is attached to and will panic otherwise. A proxy by default inherits the event queue of its parent object.
If you don't want an object to inherits its parent queue, see Proxy::make_wrapper
pub fn implement_dummy(self) -> I where
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
Implement this proxy using a dummy handler which does nothing.
pub fn implement_threadsafe<T, UD>(self, handler: T, user_data: UD) -> I where
T: Send + 'static,
UD: Send + Sync + 'static,
I: HandledBy<T> + From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
T: Send + 'static,
UD: Send + Sync + 'static,
I: HandledBy<T> + From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
Implement this proxy using the given handler and implementation data.
The handler must be a struct implementing the EventHandler
trait of the I
interface.
This function allows you to implement a proxy from an other thread than the one where its
event queue is attach, but the implementation thus must be Send
.
pub fn implement_closure_threadsafe<F, UD>(
self,
implementation: F,
user_data: UD
) -> I where
F: FnMut(I::Event, I) + Send + 'static,
UD: Send + Sync + 'static,
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
self,
implementation: F,
user_data: UD
) -> I where
F: FnMut(I::Event, I) + Send + 'static,
UD: Send + Sync + 'static,
I: From<Proxy<I>>,
I::Event: MessageGroup<Map = ProxyMap>,
Implement this proxy using given closure and implementation data from any thread.
This function allows you to implement a proxy from an other thread than the one where its
event queue is attach, but the implementation thus must be Send
.
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
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> 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, 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> Downcast for T where
T: Any,
[src]
T: Any,