pub trait Clipboard: Send {
Show 17 methods
// Required methods
fn available_formats(&self) -> Result<Vec<String>>;
fn has(&self, format: ContentFormat) -> bool;
fn clear(&self) -> Result<()>;
fn get_buffer(&self, format: &str) -> Result<Vec<u8>>;
fn get_text(&self) -> Result<String>;
fn get_rich_text(&self) -> Result<String>;
fn get_html(&self) -> Result<String>;
fn get_image(&self) -> Result<RustImageData>;
fn get_files(&self) -> Result<Vec<String>>;
fn get(&self, formats: &[ContentFormat]) -> Result<Vec<ClipboardContent>>;
fn set_buffer(&self, format: &str, buffer: Vec<u8>) -> Result<()>;
fn set_text(&self, text: String) -> Result<()>;
fn set_rich_text(&self, text: String) -> Result<()>;
fn set_html(&self, html: String) -> Result<()>;
fn set_image(&self, image: RustImageData) -> Result<()>;
fn set_files(&self, files: Vec<String>) -> Result<()>;
fn set(&self, contents: Vec<ClipboardContent>) -> Result<()>;
}
Required Methods§
Sourcefn available_formats(&self) -> Result<Vec<String>>
fn available_formats(&self) -> Result<Vec<String>>
zh: 获得剪切板当前内容的所有格式 en: Get all formats of the current content in the clipboard
fn has(&self, format: ContentFormat) -> bool
Sourcefn get_buffer(&self, format: &str) -> Result<Vec<u8>>
fn get_buffer(&self, format: &str) -> Result<Vec<u8>>
zh: 获得指定格式的数据,以字节数组形式返回 en: Get the data in the specified format in the clipboard as a byte array
Sourcefn get_text(&self) -> Result<String>
fn get_text(&self) -> Result<String>
zh: 仅获得无格式纯文本,以字符串形式返回 en: Get plain text content in the clipboard as string
Sourcefn get_rich_text(&self) -> Result<String>
fn get_rich_text(&self) -> Result<String>
zh: 获得剪贴板中的富文本内容,以字符串形式返回 en: Get the rich text content in the clipboard as string
Sourcefn get_html(&self) -> Result<String>
fn get_html(&self) -> Result<String>
zh: 获得剪贴板中的html内容,以字符串形式返回 en: Get the html format content in the clipboard as string