pub struct Set<'clipboard> {
    pub(crate) platform: Set<'clipboard>,
}Expand description
A builder for an operation that sets a value to the clipboard.
Fields§
§platform: Set<'clipboard>Implementations§
Source§impl Set<'_>
 
impl Set<'_>
Sourcepub fn text<'a, T: Into<Cow<'a, str>>>(self, text: T) -> Result<(), Error>
 
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.
Sourcepub fn html<'a, T: Into<Cow<'a, str>>>(
    self,
    html: T,
    alt_text: Option<T>,
) -> Result<(), Error>
 
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.
Sourcepub fn image(self, image: ImageData<'_>) -> Result<(), Error>
 
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: 
NSImageobject - On Linux: PNG, under the atom 
image/png - On Windows: In order of priority 
CF_DIBandCF_BITMAP 
Trait Implementations§
Source§impl SetExtLinux for Set<'_>
 
impl SetExtLinux for Set<'_>
Source§fn wait(self) -> Self
 
fn wait(self) -> Self
Whether to wait for the clipboard’s contents to be replaced after setting it. Read more
Source§fn clipboard(self, selection: LinuxClipboardKind) -> Self
 
fn clipboard(self, selection: LinuxClipboardKind) -> Self
Sets the clipboard the operation will store its data to. Read more
Source§fn wait_until(self, deadline: Instant) -> Self
 
fn wait_until(self, deadline: Instant) -> Self
Whether or not to wait for the clipboard’s content to be replaced after setting it. This waits until the
deadline has exceeded. Read moreSource§fn exclude_from_history(self) -> Self
 
fn exclude_from_history(self) -> Self
Excludes the data which will be set on the clipboard from being added to
the desktop clipboard managers’ histories by adding the MIME-Type 
x-kde-passwordMangagerHint
to the clipboard’s selection data. Read moreimpl Sealed for Set<'_>
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> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
 
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
 
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
 
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts 
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more