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:
NSImage
object - On Linux: PNG, under the atom
image/png
- On Windows: In order of priority
CF_DIB
andCF_BITMAP
Trait Implementations§
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