clipboard_win/
options.rs

1//! Configuration options
2
3use crate::SysResult;
4use crate::raw::empty;
5
6///Function type to empty clipboard
7pub type EmptyFn = fn() -> SysResult<()>;
8
9///Clearing parameter
10pub trait Clearing {
11    ///Empty behavior definition
12    const EMPTY_FN: EmptyFn;
13}
14
15#[derive(Copy, Clone)]
16///Performs no clearing of clipboard
17pub struct NoClear;
18
19fn noop() -> SysResult<()> {
20    Ok(())
21}
22
23impl Clearing for NoClear {
24    const EMPTY_FN: EmptyFn = noop;
25}
26
27#[derive(Copy, Clone)]
28///Performs clearing of clipboard before pasting
29pub struct DoClear;
30
31impl Clearing for DoClear {
32    const EMPTY_FN: EmptyFn = empty;
33}