Trait Clipboard

Source
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§

Source

fn available_formats(&self) -> Result<Vec<String>>

zh: 获得剪切板当前内容的所有格式 en: Get all formats of the current content in the clipboard

Source

fn has(&self, format: ContentFormat) -> bool

Source

fn clear(&self) -> Result<()>

zh: 清空剪切板 en: clear clipboard

Source

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

Source

fn get_text(&self) -> Result<String>

zh: 仅获得无格式纯文本,以字符串形式返回 en: Get plain text content in the clipboard as string

Source

fn get_rich_text(&self) -> Result<String>

zh: 获得剪贴板中的富文本内容,以字符串形式返回 en: Get the rich text content in the clipboard as string

Source

fn get_html(&self) -> Result<String>

zh: 获得剪贴板中的html内容,以字符串形式返回 en: Get the html format content in the clipboard as string

Source

fn get_image(&self) -> Result<RustImageData>

Source

fn get_files(&self) -> Result<Vec<String>>

Source

fn get(&self, formats: &[ContentFormat]) -> Result<Vec<ClipboardContent>>

Source

fn set_buffer(&self, format: &str, buffer: Vec<u8>) -> Result<()>

Source

fn set_text(&self, text: String) -> Result<()>

Source

fn set_rich_text(&self, text: String) -> Result<()>

Source

fn set_html(&self, html: String) -> Result<()>

Source

fn set_image(&self, image: RustImageData) -> Result<()>

Source

fn set_files(&self, files: Vec<String>) -> Result<()>

Source

fn set(&self, contents: Vec<ClipboardContent>) -> Result<()>

set image will clear clipboard

Implementors§