[−][src]Struct wayland_server::Main
A main handle to a proxy
Methods
impl<I: Interface> Main<I> where
I: AsRef<Resource<I>> + From<Resource<I>>, [src]
I: AsRef<Resource<I>> + From<Resource<I>>,
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]
I: AsRef<Resource<I>> + From<Resource<I>>,
E: From<(Main<I>, I::Request)> + 'static,
I::Request: MessageGroup<Map = ResourceMap>,
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 assign_mono<F>(&self, f: F) where
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
F: FnMut(Main<I>, I::Request) + 'static,
I::Request: MessageGroup<Map = ResourceMap>, [src]
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
F: FnMut(Main<I>, I::Request) + 'static,
I::Request: MessageGroup<Map = ResourceMap>,
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]
I: AsRef<Resource<I>> + From<Resource<I>>,
E: From<Resource<I>> + 'static,
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. You must ensure that this object was newly
created and have never been user nor had any listener associated.
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
Trait Implementations
impl<I: Clone + Interface + AsRef<Resource<I>> + From<Resource<I>>> Clone for Main<I>[src]
impl<I: PartialEq + Interface + AsRef<Resource<I>> + From<Resource<I>>> PartialEq<Main<I>> for Main<I>[src]
impl<I> Deref for Main<I> where
I: Interface + AsRef<Resource<I>> + From<Resource<I>>, [src]
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
Auto Trait Implementations
impl<I> !Send for Main<I>
impl<I> Unpin for Main<I> where
I: Unpin,
I: Unpin,
impl<I> !Sync for Main<I>
impl<I> UnwindSafe for Main<I> where
I: UnwindSafe,
I: UnwindSafe,
impl<I> RefUnwindSafe for Main<I> where
I: RefUnwindSafe,
I: RefUnwindSafe,
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, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> From<T> for 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>,
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> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Downcast for T where
T: Any, [src]
T: Any,