Struct arboard::Set

source ·
pub struct Set<'clipboard> { /* private fields */ }
Expand description

A builder for an operation that sets a value to the clipboard.

Implementations§

source§

impl Set<'_>

source

pub fn text<'a, T: Into<Cow<'a, str>>>(self, text: T) -> Result<(), Error>

Completes the “set” operation by placing text onto the clipboard. Any valid UTF-8 string is accepted.

source

pub fn html<'a, T: Into<Cow<'a, str>>>( self, html: T, alt_text: Option<T> ) -> Result<(), Error>

Completes the “set” operation by placing HTML as well as a plain-text alternative onto the clipboard.

Any valid UTF-8 string is accepted.

source

pub fn image(self, image: ImageData<'_>) -> Result<(), Error>

Completes the “set” operation by placing an image onto the clipboard.

The chosen output format, depending on the platform is the following:

  • On macOS: NSImage object
  • On Linux: PNG, under the atom image/png
  • On Windows: In order of priority CF_DIB and CF_BITMAP

Trait Implementations§

source§

impl SetExtWindows for Set<'_>

source§

fn exclude_from_monitoring(self) -> Self

Exclude the data which will be set on the clipboard from being processed at all, either in the local clipboard history or getting uploaded to the cloud. Read more
source§

fn exclude_from_cloud(self) -> Self

Excludes the data which will be set on the clipboard from being uploaded to the Windows 10/11 cloud clipboard.
source§

fn exclude_from_history(self) -> Self

Excludes the data which will be set on the clipboard from being added to the system’s clipboard history list.

Auto Trait Implementations§

§

impl<'clipboard> Freeze for Set<'clipboard>

§

impl<'clipboard> RefUnwindSafe for Set<'clipboard>

§

impl<'clipboard> !Send for Set<'clipboard>

§

impl<'clipboard> !Sync for Set<'clipboard>

§

impl<'clipboard> Unpin for Set<'clipboard>

§

impl<'clipboard> !UnwindSafe for Set<'clipboard>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.