[][src]Struct wayland_server::Main

pub struct Main<I: Interface + AsRef<Resource<I>> + From<Resource<I>>> { /* fields omitted */ }

A main handle to a proxy

Implementations

impl<I: Interface> Main<I> where
    I: AsRef<Resource<I>> + From<Resource<I>>, 
[src]

pub fn assign<E>(&self, filter: Filter<E>) where
    I: AsRef<Resource<I>> + From<Resource<I>>,
    E: From<(Main<I>, I::Request)> + 'static,
    I::Request: MessageGroup<Map = ResourceMap>, 
[src]

Assign this object to given filter

All future requests received by this object will be delivered to this filter.

An object that is not assigned to any filter will see trigger a protocol error and kill its client signalling a server bug if it receives a request.

Message type of the filter should verify E: From<(Main<I>, I::Request)>. See the request_enum! macro provided in this library to easily generate appropriate types.

pub fn quick_assign<F>(&self, f: F) where
    I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
    F: FnMut(Main<I>, I::Request, DispatchData) + 'static,
    I::Request: MessageGroup<Map = ResourceMap>, 
[src]

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).

pub fn assign_destructor<E>(&self, filter: Filter<E>) where
    I: AsRef<Resource<I>> + From<Resource<I>>,
    E: From<Resource<I>> + 'static, 
[src]

Assign a destructor to this object

The filter will be called upon destruction of this object with a payload of type Resource<I>.

pub unsafe fn init_from_c_ptr(_ptr: *mut wl_resource) -> Self[src]

Create a Main instance from a C pointer to a new object

Create a Main from a raw pointer to a wayland object from the C library by taking control of it.

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

The provided pointer must be a valid pointer to a wayland object from libwayland-client associated to the correct interface.

You must ensure that this object was newly created and have never been user nor had any listener associated.

Trait Implementations

impl<I: Clone + Interface + AsRef<Resource<I>> + From<Resource<I>>> Clone for Main<I>[src]

impl<I: Interface> Debug for Main<I> where
    I: Debug + AsRef<Resource<I>> + From<Resource<I>>, 
[src]

impl<I> Deref for Main<I> where
    I: Interface + AsRef<Resource<I>> + From<Resource<I>>, 
[src]

type Target = I

The resulting type after dereferencing.

impl<I: PartialEq + Interface + AsRef<Resource<I>> + From<Resource<I>>> PartialEq<Main<I>> for Main<I>[src]

impl<I: Interface + AsRef<Resource<I>> + From<Resource<I>>> StructuralPartialEq for Main<I>[src]

Auto Trait Implementations

impl<I> RefUnwindSafe for Main<I> where
    I: RefUnwindSafe

impl<I> !Send for Main<I>

impl<I> !Sync for Main<I>

impl<I> Unpin for Main<I> where
    I: Unpin

impl<I> UnwindSafe for Main<I> where
    I: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Downcast for T where
    T: Any
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.