[−][src]Struct wl_clipboard_rs::copy::Options
Options and flags that are used to customize the copying.
Implementations
impl Options
[src]
pub fn new() -> Self
[src]
Creates a blank new set of options ready for configuration.
pub fn clipboard(&mut self, clipboard: ClipboardType) -> &mut Self
[src]
Sets the clipboard to work with.
pub fn seat(&mut self, seat: Seat) -> &mut Self
[src]
Sets the seat to use for copying.
pub fn trim_newline(&mut self, trim_newline: bool) -> &mut Self
[src]
Sets the flag for trimming the trailing newline.
This flag is only applied for text MIME types.
pub fn foreground(&mut self, foreground: bool) -> &mut Self
[src]
Sets the flag for not spawning a separate thread for serving copy requests.
Setting this flag will result in the call to copy()
blocking until all data sources
it creates are destroyed, e.g. until someone else copies something into the clipboard.
pub fn serve_requests(&mut self, serve_requests: ServeRequests) -> &mut Self
[src]
Sets the number of requests to serve.
Limiting the number of requests to one effectively clears the clipboard after the first paste. It can be used when copying e.g. sensitive data, like passwords. Note however that certain apps may have issues pasting when this option is used, in particular XWayland clients are known to suffer from this.
pub fn copy(self, source: Source, mime_type: MimeType) -> Result<(), Error>
[src]
Invokes the copy operation. See copy()
.
Examples
use wl_clipboard_rs::copy::{MimeType, Options, Source}; let opts = Options::new(); opts.copy(Source::Bytes([1, 2, 3][..].into()), MimeType::Autodetect)?;
pub fn copy_multi(self, sources: Vec<MimeSource>) -> Result<(), Error>
[src]
Invokes the copy_multi operation. See copy_multi()
.
Examples
use wl_clipboard_rs::copy::{MimeSource, MimeType, Options, Source}; let opts = Options::new(); opts.copy_multi(vec![MimeSource { source: Source::Bytes([1, 2, 3][..].into()), mime_type: MimeType::Autodetect }, MimeSource { source: Source::Bytes([7, 8, 9][..].into()), mime_type: MimeType::Text }])?;
pub fn prepare_copy(
self,
source: Source,
mime_type: MimeType
) -> Result<PreparedCopy, Error>
[src]
self,
source: Source,
mime_type: MimeType
) -> Result<PreparedCopy, Error>
Invokes the prepare_copy operation. See prepare_copy()
.
Panics
Panics if foreground
is false
.
Examples
use wl_clipboard_rs::copy::{MimeSource, MimeType, Options, Source}; let mut opts = Options::new(); opts.foreground(true); let prepared_copy = opts.prepare_copy(Source::Bytes([1, 2, 3][..].into()), MimeType::Autodetect)?; prepared_copy.serve()?;
pub fn prepare_copy_multi(
self,
sources: Vec<MimeSource>
) -> Result<PreparedCopy, Error>
[src]
self,
sources: Vec<MimeSource>
) -> Result<PreparedCopy, Error>
Invokes the prepare_copy_multi operation. See prepare_copy_multi()
.
Panics
Panics if foreground
is false
.
Examples
use wl_clipboard_rs::copy::{MimeSource, MimeType, Options, Source}; let mut opts = Options::new(); opts.foreground(true); let prepared_copy = opts.prepare_copy_multi(vec![MimeSource { source: Source::Bytes([1, 2, 3][..].into()), mime_type: MimeType::Autodetect }, MimeSource { source: Source::Bytes([7, 8, 9][..].into()), mime_type: MimeType::Text }])?; prepared_copy.serve()?;
Trait Implementations
impl Clone for Options
[src]
impl Debug for Options
[src]
impl Default for Options
[src]
impl Eq for Options
[src]
impl Hash for Options
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Options
[src]
fn cmp(&self, other: &Options) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Options> for Options
[src]
impl PartialOrd<Options> for Options
[src]
fn partial_cmp(&self, other: &Options) -> Option<Ordering>
[src]
fn lt(&self, other: &Options) -> bool
[src]
fn le(&self, other: &Options) -> bool
[src]
fn gt(&self, other: &Options) -> bool
[src]
fn ge(&self, other: &Options) -> bool
[src]
impl StructuralEq for Options
[src]
impl StructuralPartialEq for Options
[src]
Auto Trait Implementations
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnwindSafe for Options
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> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,