MCPcopy Index your code
hub / github.com/ChrisFeldmeier/OpenCodeRust / read

Method read

crates/opencode-tui/src/ui/clipboard.rs:14–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13impl Clipboard {
14 pub fn read() -> anyhow::Result<ClipboardContent> {
15 if let Ok(image_data) = read_image_from_clipboard() {
16 return Ok(ClipboardContent {
17 data: image_data,
18 mime: "image/png".to_string(),
19 });
20 }
21
22 let text = Self::read_text()?;
23 Ok(ClipboardContent {
24 data: text,
25 mime: "text/plain".to_string(),
26 })
27 }
28
29 pub fn read_text() -> anyhow::Result<String> {
30 if cfg!(target_os = "macos") {

Callers 15

has_serverMethod · 0.80
start_oauthMethod · 0.80
get_serverMethod · 0.80
list_serversMethod · 0.80
get_logsMethod · 0.80
remove_oauthMethod · 0.80
managed_serverMethod · 0.80
oauth_status_forMethod · 0.80
session_statusFunction · 0.80
stream_messageFunction · 0.80
session_promptFunction · 0.80
get_configFunction · 0.80

Calls 1

Tested by

no test coverage detected