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

A main handle to a proxy

Implementations

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.

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

Assign a destructor to this object

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

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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.