[−][src]Struct wayland_server::Main
A main handle to a proxy
Implementations
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 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]
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
F: FnMut(Main<I>, I::Request, DispatchData) + '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.
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]
I: Debug + AsRef<Resource<I>> + From<Resource<I>>,
impl<I> Deref for Main<I> where
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
[src]
I: Interface + AsRef<Resource<I>> + From<Resource<I>>,
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,
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>,