pub type Clipboard = PlatformClipboard<Clipboard>;
Aliased Type§
struct Clipboard { /* private fields */ }
Implementations
Source§impl<C: ClipboardProvider> PlatformClipboard<C>
impl<C: ClipboardProvider> PlatformClipboard<C>
pub fn read_primary(&self) -> Option<Result<String, Box<dyn Error>>>
pub fn write_primary( &mut self, contents: String, ) -> Option<Result<(), Box<dyn Error>>>
pub fn read_data<T>(&self) -> Option<Result<T, Box<dyn Error>>>where
T: AllowedMimeTypes + 'static,
pub fn write_data<T>( &mut self, contents: ClipboardStoreData<T>, ) -> Option<Result<(), Box<dyn Error>>>
pub fn read_primary_data<T>(&self) -> Option<Result<T, Box<dyn Error>>>where
T: AllowedMimeTypes + 'static,
pub fn read_primary_raw( &self, allowed: Vec<String>, ) -> Option<Result<(Vec<u8>, String), Box<dyn Error>>>
pub fn read_raw( &self, allowed: Vec<String>, ) -> Option<Result<(Vec<u8>, String), Box<dyn Error>>>
pub fn write_primary_data<T>( &mut self, contents: ClipboardStoreData<T>, ) -> Option<Result<(), Box<dyn Error>>>
Source§impl PlatformClipboard<Clipboard>
impl PlatformClipboard<Clipboard>
Sourcepub unsafe fn connect<W: HasDisplayHandle + ?Sized>(
window: &W,
) -> Result<Self, Box<dyn Error>>
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
pub fn read(&self) -> Result<String, Box<dyn Error>>
pub fn write(&mut self, contents: String) -> Result<(), Box<dyn Error>>
Trait Implementations
Source§impl<C: DndProvider> DndProvider for PlatformClipboard<C>
impl<C: DndProvider> DndProvider for PlatformClipboard<C>
Source§fn init_dnd(&self, tx: Box<dyn Sender<DndSurface> + Send + Sync + 'static>)
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,
)
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 register_dnd_destination(
&self,
surface: DndSurface,
rectangles: Vec<DndDestinationRectangle>,
)
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)
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>
fn peek_offer<D: AllowedMimeTypes + 'static>( &self, mime_type: Option<Cow<'static, str>>, ) -> Result<D>
Peek at the contents of a DnD offer