mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-05-25 13:17:47 +02:00
25 lines
604 B
Rust
25 lines
604 B
Rust
// Copyright 2019-2023 Tauri Programme within The Commons Conservancy
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
// SPDX-License-Identifier: MIT
|
|
|
|
use tauri::{command, AppHandle, Runtime, State};
|
|
|
|
use crate::{ClipKind, Clipboard, ClipboardContents, Result};
|
|
|
|
#[command]
|
|
pub(crate) async fn write<R: Runtime>(
|
|
_app: AppHandle<R>,
|
|
clipboard: State<'_, Clipboard<R>>,
|
|
data: ClipKind,
|
|
) -> Result<()> {
|
|
clipboard.write(data)
|
|
}
|
|
|
|
#[command]
|
|
pub(crate) async fn read<R: Runtime>(
|
|
_app: AppHandle<R>,
|
|
clipboard: State<'_, Clipboard<R>>,
|
|
) -> Result<ClipboardContents> {
|
|
clipboard.read()
|
|
}
|