[−][src]Struct remote_clipboard::Clipboard
Fields
config: ConfigContext
Implementations
impl Clipboard
[src]
pub fn from(config: ConfigContext) -> Clipboard
[src]
pub fn copy(&self, input: &mut dyn Read) -> Result<(), ClipboardError>
[src]
Push readable data into the remote clipboard
Arguments
input
- A readable object
Example
use remote_clipboard as rclip; use std::path::PathBuf; use url::Url; let clipboard = rclip::Clipboard::from(rclip::config::ConfigContext { config_path: PathBuf::from("/blah"), base_url: url::Url::parse("https://toto.com").unwrap(), token: String::from("token"), }); clipboard.copy(&mut "toto".as_bytes());
pub fn paste(&self, output: &mut dyn Write) -> Result<(), ClipboardError>
[src]
Pull data from the remote clipboard
Example
use remote_clipboard as rclip; use std::io::{self}; use std::path::PathBuf; use url::Url; let clipboard = rclip::Clipboard::from(rclip::config::ConfigContext { config_path: PathBuf::from("/blah"), base_url: url::Url::parse("https://toto.com").unwrap(), token: String::from("token"), }); let stdout = io::stdout(); clipboard.paste(&mut stdout.lock());
pub fn open(&mut self) -> Result<(), ClipboardError>
[src]
Open a new remote clipboard and display a short living hash for linking another client.
Example
use remote_clipboard as rclip; use std::path::PathBuf; use url::Url; let mut clipboard = rclip::Clipboard::from(rclip::config::ConfigContext { config_path: PathBuf::from("/blah"), base_url: url::Url::parse("https://toto.com").unwrap(), token: String::from("token"), }); clipboard.open();
pub fn link(&mut self, input: &mut dyn Read) -> Result<(), ClipboardError>
[src]
Link against newly opened remote clipboard
Arguments
input
- A readable object containing the short living hash
Example
use remote_clipboard as rclip; use std::io::{self}; use std::path::PathBuf; use url::Url; let mut clipboard = rclip::Clipboard::from(rclip::config::ConfigContext { config_path: PathBuf::from("/blah"), base_url: url::Url::parse("https://toto.com").unwrap(), token: String::from("token"), }); clipboard.link(&mut "012345".as_bytes());
TODO: check input size
Auto Trait Implementations
impl RefUnwindSafe for Clipboard
impl Send for Clipboard
impl Sync for Clipboard
impl Unpin for Clipboard
impl UnwindSafe for Clipboard
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,