pub struct ClipboardItem { /* private fields */ }Expand description
A clipboard item that should be copied to the clipboard
Implementations§
Source§impl ClipboardItem
impl ClipboardItem
Sourcepub fn new_string(text: String) -> Self
pub fn new_string(text: String) -> Self
Create a new ClipboardItem::String with no associated metadata
Sourcepub fn new_string_with_metadata(text: String, metadata: String) -> Self
pub fn new_string_with_metadata(text: String, metadata: String) -> Self
Create a new ClipboardItem::String with the given text and associated metadata
Sourcepub fn new_string_with_json_metadata<T: Serialize>(
text: String,
metadata: T,
) -> Self
pub fn new_string_with_json_metadata<T: Serialize>( text: String, metadata: T, ) -> Self
Create a new ClipboardItem::String with the given text and associated metadata
Sourcepub fn new_image(image: &Image) -> Self
pub fn new_image(image: &Image) -> Self
Create a new ClipboardItem::Image with the given image with no associated metadata
Sourcepub fn text(&self) -> Option<String>
pub fn text(&self) -> Option<String>
Concatenates together all the ClipboardString entries in the item. Returns None if there were no ClipboardString entries.
Sourcepub fn metadata(&self) -> Option<&String>
pub fn metadata(&self) -> Option<&String>
If this item is one ClipboardEntry::String, returns its metadata.
Sourcepub fn entries(&self) -> &[ClipboardEntry]
pub fn entries(&self) -> &[ClipboardEntry]
Get the item’s entries
Sourcepub fn into_entries(self) -> impl Iterator<Item = ClipboardEntry>
pub fn into_entries(self) -> impl Iterator<Item = ClipboardEntry>
Get owned versions of the item’s entries
Trait Implementations§
Source§impl Clone for ClipboardItem
impl Clone for ClipboardItem
Source§fn clone(&self) -> ClipboardItem
fn clone(&self) -> ClipboardItem
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ClipboardItem
impl Debug for ClipboardItem
Source§impl From<ClipboardEntry> for ClipboardItem
impl From<ClipboardEntry> for ClipboardItem
Source§fn from(value: ClipboardEntry) -> Self
fn from(value: ClipboardEntry) -> Self
Converts to this type from the input type.
Source§impl From<Image> for ClipboardItem
impl From<Image> for ClipboardItem
Source§impl From<String> for ClipboardItem
impl From<String> for ClipboardItem
Source§impl PartialEq for ClipboardItem
impl PartialEq for ClipboardItem
impl Eq for ClipboardItem
impl StructuralPartialEq for ClipboardItem
Auto Trait Implementations§
impl Freeze for ClipboardItem
impl RefUnwindSafe for ClipboardItem
impl Send for ClipboardItem
impl Sync for ClipboardItem
impl Unpin for ClipboardItem
impl UnwindSafe for ClipboardItem
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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