[−][src]Struct wayland_client::Main
A main handle to a proxy
This handle allows the same control as an Attached
handle,
but additionnaly can be used to assign the proxy to a Filter
,
in order to process its events.
Implementations
impl<I: Interface> Main<I> where
I: AsRef<Proxy<I>> + From<Proxy<I>>,
[src]
I: AsRef<Proxy<I>> + From<Proxy<I>>,
pub fn assign<E>(&self, filter: Filter<E>) where
I: Sync,
E: From<(Main<I>, I::Event)> + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
I: Sync,
E: From<(Main<I>, I::Event)> + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
Assign this object to given filter
All future event received by this object will be delivered to this filter.
An object that is not assigned to any filter will see its events delivered to the fallback callback of its event queue.
Event message type of the filter should verify
E: From<(Main<I>, I::Event)>
. See the event_enum!
macro provided
in this library to easily generate appropriate types.
pub fn quick_assign<F>(&self, f: F) where
I: Interface + AsRef<Proxy<I>> + From<Proxy<I>> + Sync,
F: FnMut(Main<I>, I::Event, DispatchData<'_>) + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
[src]
I: Interface + AsRef<Proxy<I>> + From<Proxy<I>> + Sync,
F: FnMut(Main<I>, I::Event, DispatchData<'_>) + 'static,
I::Event: MessageGroup<Map = ProxyMap>,
Shorthand for assigning a closure to an object
Behaves similarly as assign(..)
, but is a shorthand if
you want to assign this object to its own filter. In which
case you just need to provide the appropriate closure, of
type FnMut(Main<I>, I::Event)
.
impl Main<AnonymousObject>
[src]
pub fn deanonymize<I: Interface + AsRef<Proxy<I>> + From<Proxy<I>>>(
self
) -> Result<Main<I>, Self>
[src]
self
) -> Result<Main<I>, Self>
Attempt to recover the typed variant of an anonymous proxy
impl<I: Interface> Main<I> where
I: AsRef<Proxy<I>> + From<Proxy<I>>,
[src]
I: AsRef<Proxy<I>> + From<Proxy<I>>,
pub unsafe fn from_c_ptr(_ptr: *mut wl_proxy) -> Main<I>
[src]
Create a Main
instance from a C pointer
Create a Main
from a raw pointer to a wayland object from the
C library.
In order to handle protocol races, invoking it with a NULL pointer will create an already-dead object.
NOTE: This method will panic if called while the use_system_lib
feature is
not activated.
Safety
This will take control of the underlying proxy & manage it. To be safe you must ensure that:
- The provided proxy has not already been used in any way (it was just created)
- This is called from the same thread as the one hosting the event queue handling this proxy
Methods from Deref<Target = Attached<I>>
Trait Implementations
impl<I: Clone + Interface + AsRef<Proxy<I>> + From<Proxy<I>>> Clone for Main<I>
[src]
impl<I: Interface> Debug for Main<I> where
I: Debug + AsRef<Proxy<I>> + From<Proxy<I>>,
[src]
I: Debug + AsRef<Proxy<I>> + From<Proxy<I>>,
impl<I: Interface> Deref for Main<I> where
I: AsRef<Proxy<I>> + From<Proxy<I>>,
[src]
I: AsRef<Proxy<I>> + From<Proxy<I>>,
type Target = Attached<I>
The resulting type after dereferencing.
fn deref(&self) -> &Attached<I>
[src]
impl<I: Interface> From<Main<I>> for Attached<I> where
I: AsRef<Proxy<I>> + From<Proxy<I>>,
[src]
I: AsRef<Proxy<I>> + From<Proxy<I>>,
impl<I: PartialEq + Interface + AsRef<Proxy<I>> + From<Proxy<I>>> PartialEq<Main<I>> for Main<I>
[src]
impl<I: Interface + AsRef<Proxy<I>> + From<Proxy<I>>> StructuralPartialEq for Main<I>
[src]
Auto Trait Implementations
impl<I> RefUnwindSafe for Main<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
impl<I> !Send for Main<I>
impl<I> !Sync for Main<I>
impl<I> Unpin for Main<I> where
I: Unpin,
I: Unpin,
impl<I> UnwindSafe for Main<I> where
I: UnwindSafe,
I: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> Downcast for T where
T: Any,
[src]
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
[src]
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
[src]
fn as_any(&self) -> &(dyn Any + 'static)
[src]
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
[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> 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, 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>,