wl_clipboard_rs::copy

Function copy_multi

source
pub fn copy_multi(
    options: Options,
    sources: Vec<MimeSource>,
) -> Result<(), Error>
Expand description

Copies data to the clipboard, offering multiple data sources.

The data from each source in sources is copied and offered in the corresponding MIME type. See Options for customizing the behavior of this operation.

If multiple sources specify the same MIME type, the first one is offered. If one of the MIME types is text, all automatically added plain text offers will fall back to the first source with a text MIME type.

ยงExamples

use wl_clipboard_rs::copy::{MimeSource, MimeType, Options, Source};

let opts = Options::new();
opts.copy_multi(vec![MimeSource { source: Source::Bytes([1, 2, 3][..].into()),
                                  mime_type: MimeType::Autodetect },
                     MimeSource { source: Source::Bytes([7, 8, 9][..].into()),
                                  mime_type: MimeType::Text }])?;