Mountain/IPC/WindServiceHandlers/NativeHost/ClipboardReadText.rs
1#![allow(unused_variables, dead_code, unused_imports)]
2
3//! Wire method: `nativeHost:readClipboardText`.
4
5use serde_json::{Value, json};
6
7pub async fn Fn(_Arguments:Vec<Value>) -> Result<Value, String> {
8 match arboard::Clipboard::new() {
9 Ok(mut Cb) => Ok(json!(Cb.get_text().unwrap_or_default())),
10
11 Err(_) => Ok(json!("")),
12 }
13}