pub struct WlDataSource { /* private fields */ }
Expand description
offer to transfer data
The wl_data_source object is the source side of a wl_data_offer. It is created by the source client in a data transfer and provides a way to describe the offered data and a way to respond to requests to transfer the data.
See also the Event enum for this interface.
Implementations§
Source§impl WlDataSource
impl WlDataSource
Sourcepub fn offer(&self, mime_type: String)
pub fn offer(&self, mime_type: String)
add an offered mime type
This request adds a mime type to the set of mime types advertised to targets. Can be called several times to offer multiple types.
Sourcepub fn set_actions(&self, dnd_actions: DndAction)
pub fn set_actions(&self, dnd_actions: DndAction)
set the available drag-and-drop actions
Sets the actions that the source side client supports for this operation. This request may trigger wl_data_source.action and wl_data_offer.action events if the compositor needs to change the selected action.
The dnd_actions argument must contain only values expressed in the wl_data_device_manager.dnd_actions enum, otherwise it will result in a protocol error.
This request must be made once only, and can only be made on sources used in drag-and-drop, so it must be performed before wl_data_device.start_drag. Attempting to use the source other than for drag-and-drop will raise a protocol error.
Trait Implementations§
Source§impl Borrow<ObjectId> for WlDataSource
impl Borrow<ObjectId> for WlDataSource
Source§impl Clone for WlDataSource
impl Clone for WlDataSource
Source§fn clone(&self) -> WlDataSource
fn clone(&self) -> WlDataSource
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WlDataSource
impl Debug for WlDataSource
Source§impl<D, U> Dispatch<WlDataSource, U, D> for DataDeviceManagerState
impl<D, U> Dispatch<WlDataSource, U, D> for DataDeviceManagerState
Source§fn event(
state: &mut D,
source: &WlDataSource,
event: <WlDataSource as Proxy>::Event,
_data: &U,
conn: &Connection,
qh: &QueueHandle<D>,
)
fn event( state: &mut D, source: &WlDataSource, event: <WlDataSource as Proxy>::Event, _data: &U, conn: &Connection, qh: &QueueHandle<D>, )
Source§fn event_created_child(
opcode: u16,
_qhandle: &QueueHandle<State>,
) -> Arc<dyn ObjectData>
fn event_created_child( opcode: u16, _qhandle: &QueueHandle<State>, ) -> Arc<dyn ObjectData>
Source§impl Hash for WlDataSource
impl Hash for WlDataSource
Source§impl PartialEq<Weak<WlDataSource>> for WlDataSource
impl PartialEq<Weak<WlDataSource>> for WlDataSource
Source§impl PartialEq for WlDataSource
impl PartialEq for WlDataSource
Source§impl Proxy for WlDataSource
impl Proxy for WlDataSource
Source§fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
fn object_data(&self) -> Option<&Arc<dyn ObjectData>>
Source§fn backend(&self) -> &WeakBackend
fn backend(&self) -> &WeakBackend
Source§fn send_request(
&self,
req: <WlDataSource as Proxy>::Request<'_>,
) -> Result<(), InvalidId>
fn send_request( &self, req: <WlDataSource as Proxy>::Request<'_>, ) -> Result<(), InvalidId>
Source§fn send_constructor<I>(
&self,
req: <WlDataSource as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
fn send_constructor<I>(
&self,
req: <WlDataSource as Proxy>::Request<'_>,
data: Arc<dyn ObjectData>,
) -> Result<I, InvalidId>where
I: Proxy,
Source§fn from_id(conn: &Connection, id: ObjectId) -> Result<WlDataSource, InvalidId>
fn from_id(conn: &Connection, id: ObjectId) -> Result<WlDataSource, InvalidId>
Source§fn inert(backend: WeakBackend) -> WlDataSource
fn inert(backend: WeakBackend) -> WlDataSource
Source§fn parse_event(
conn: &Connection,
msg: Message<ObjectId, OwnedFd>,
) -> Result<(WlDataSource, <WlDataSource as Proxy>::Event), DispatchError>
fn parse_event( conn: &Connection, msg: Message<ObjectId, OwnedFd>, ) -> Result<(WlDataSource, <WlDataSource as Proxy>::Event), DispatchError>
Source§fn write_request<'a>(
&self,
conn: &Connection,
msg: <WlDataSource as Proxy>::Request<'a>,
) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
fn write_request<'a>( &self, conn: &Connection, msg: <WlDataSource as Proxy>::Request<'a>, ) -> Result<(Message<ObjectId, BorrowedFd<'a>>, Option<(&'static Interface, u32)>), InvalidId>
impl Eq for WlDataSource
Auto Trait Implementations§
impl Freeze for WlDataSource
impl !RefUnwindSafe for WlDataSource
impl Send for WlDataSource
impl Sync for WlDataSource
impl Unpin for WlDataSource
impl !UnwindSafe for WlDataSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more