window_clipboard

Type Alias Clipboard

Source
pub type Clipboard = PlatformClipboard<Clipboard>;

Aliased Type§

struct Clipboard { /* private fields */ }

Implementations

Source§

impl<C: ClipboardProvider> PlatformClipboard<C>

Source

pub fn read_primary(&self) -> Option<Result<String, Box<dyn Error>>>

Source

pub fn write_primary( &mut self, contents: String, ) -> Option<Result<(), Box<dyn Error>>>

Source

pub fn read_data<T>(&self) -> Option<Result<T, Box<dyn Error>>>
where T: AllowedMimeTypes + 'static,

Source

pub fn write_data<T>( &mut self, contents: ClipboardStoreData<T>, ) -> Option<Result<(), Box<dyn Error>>>
where T: AsMimeTypes + Send + Sync + 'static,

Source

pub fn read_primary_data<T>(&self) -> Option<Result<T, Box<dyn Error>>>
where T: AllowedMimeTypes + 'static,

Source

pub fn read_primary_raw( &self, allowed: Vec<String>, ) -> Option<Result<(Vec<u8>, String), Box<dyn Error>>>

Source

pub fn read_raw( &self, allowed: Vec<String>, ) -> Option<Result<(Vec<u8>, String), Box<dyn Error>>>

Source

pub fn write_primary_data<T>( &mut self, contents: ClipboardStoreData<T>, ) -> Option<Result<(), Box<dyn Error>>>
where T: AsMimeTypes + Send + Sync + 'static,

Source§

impl PlatformClipboard<Clipboard>

Source

pub unsafe fn connect<W: HasDisplayHandle + ?Sized>( window: &W, ) -> Result<Self, Box<dyn Error>>

Safety: the display handle must be valid for the lifetime of Clipboard

Source

pub fn read(&self) -> Result<String, Box<dyn Error>>

Source

pub fn write(&mut self, contents: String) -> Result<(), Box<dyn Error>>

Trait Implementations

Source§

impl<C: DndProvider> DndProvider for PlatformClipboard<C>

Source§

fn init_dnd(&self, tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>)

Set up DnD operations for the Clipboard
Source§

fn start_dnd<D: AsMimeTypes + Send + 'static>( &self, internal: bool, source_surface: DndSurface, icon_surface: Option<Icon>, content: D, actions: DndAction, )

Start a DnD operation on the given surface with some data
Source§

fn end_dnd(&self)

End the current DnD operation, if there is one
Source§

fn register_dnd_destination( &self, surface: DndSurface, rectangles: Vec<DndDestinationRectangle>, )

Register a surface for receiving DnD offers Rectangles should be provided in order of decreasing priority. This method can be called multiple time for a single surface if the rectangles change.
Source§

fn set_action(&self, action: DndAction)

Set the final action after presenting the user with a choice
Source§

fn peek_offer<D: AllowedMimeTypes + 'static>( &self, mime_type: Option<Cow<'static, str>>, ) -> Result<D>

Peek at the contents of a DnD offer