Struct smithay_clipboard::Clipboard
source · pub struct Clipboard {
pub(crate) request_sender: Sender<Command>,
pub(crate) request_receiver: Receiver<Result<String>>,
pub(crate) clipboard_thread: Option<JoinHandle<()>>,
}
Expand description
Access to a Wayland clipboard.
Fields§
§request_sender: Sender<Command>
§request_receiver: Receiver<Result<String>>
§clipboard_thread: Option<JoinHandle<()>>
Implementations§
source§impl Clipboard
impl Clipboard
sourcepub unsafe fn new(display: *mut c_void) -> Self
pub unsafe fn new(display: *mut c_void) -> Self
Creates new clipboard which will be running on its own thread with its own event queue to handle clipboard requests.
§Safety
display
must be a valid *mut wl_display
pointer, and it must remain
valid for as long as Clipboard
object is alive.
sourcepub fn load(&self) -> Result<String>
pub fn load(&self) -> Result<String>
Load clipboard data.
Loads content from a clipboard on a last observed seat.
sourcepub fn store<T: Into<String>>(&self, text: T)
pub fn store<T: Into<String>>(&self, text: T)
Store to a clipboard.
Stores to a clipboard on a last observed seat.
sourcepub fn load_primary(&self) -> Result<String>
pub fn load_primary(&self) -> Result<String>
Load primary clipboard data.
Loads content from a primary clipboard on a last observed seat.
sourcepub fn store_primary<T: Into<String>>(&self, text: T)
pub fn store_primary<T: Into<String>>(&self, text: T)
Store to a primary clipboard.
Stores to a primary clipboard on a last observed seat.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Clipboard
impl !RefUnwindSafe for Clipboard
impl Send for Clipboard
impl !Sync for Clipboard
impl Unpin for Clipboard
impl !UnwindSafe for 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> 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.