# [−][src]Enum smithay_client_toolkit::data_device::DataSourceEvent

    pub enum DataSourceEvent {
        Send {
            mime_type: String,
            pipe: WritePipe,
        },
        Target {
            mime_type: Option<String>,
        },
        Action {
            action: DndAction,
        },
        Cancelled,
        Dropped,
        Finished,
    }

Possible events a data source needs to react to

## Variants

`Send`

Write the offered data for selected mime type

This can happen several times during a dnd setup, and does not mean the action is finished.

### Fields of Send

`mime_type: String`

Requested mime type

`pipe: WritePipe`

Pipe to write into

`Target`

Target mime type

Notifies that the target accepted a given mime type. You can use it to provide feedback (changing the icon of the drag'n'drop for example).

Can be `None` if the current target does not accept any of the proposed mime types.

This event can be emitted several times during the process

### Fields of Target

`mime_type: Option<String>`

The type accepted by the target

`Action`

Notifies of the current selected action for the drag'n'drop

Can only happen for data sources used during a drag'n'drop.

This can change several times, the last received defines which action should actually be taken.

### Fields of Action

`action: DndAction`

The action chosen by the target

`Cancelled`

The action using this data source was cancelled.

Once this event is received, the `DataSource` can not be used any more, and you should drop it for cleanup.

Happens if the user cancels the current drag'n'drop, or replaces the selection buffer.

`Dropped`

The user performed the "drop" during a drag'n'drop

This does not mean the operation is finished (the operation can still be cancelled afterwards).

You are not guaranteed to receive this event at some point, as the compositor may cancel the action before the user drops.

This event can only be generated on sources used for drag'n'drop, not selection sources.

`Finished`

The action is finished, this data source will not be used any more

If the selected drag'n'drop action was "move", you can now delete the underlying resource.

This event can only be generated on sources used for drag'n'drop, not selection sources.

## Auto Trait Implementations

### `impl Send for DataSourceEvent`

### `impl Unpin for DataSourceEvent`

### `impl Sync for DataSourceEvent`

### `impl UnwindSafe for DataSourceEvent`

### `impl RefUnwindSafe for DataSourceEvent`

## Blanket Implementations

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

#### `fn into(self) -> U`[src]

Performs the conversion.

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

#### `fn from(t: T) -> T`[src]

Performs the conversion.

### `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.

#### `fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>`[src]

Performs the conversion.

### `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.

#### `fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>`[src]

Performs the conversion.

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

#### `fn borrow_mut(&mut self) -> &mut T`[src]

Mutably borrows from an owned value. Read more

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

#### `fn borrow(&self) -> &T`[src]

Immutably borrows from an owned value. Read more

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

#### `fn type_id(&self) -> TypeId`[src]

Gets the `TypeId` of `self`. Read more

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)