pub struct MemoryClipboard { /* private fields */ }Expand description
In-memory clipboard used by headless tests and by apps that opt out of the real system clipboard. Not shared across processes.
Implementations§
Trait Implementations§
Source§impl ClipboardBackend for MemoryClipboard
impl ClipboardBackend for MemoryClipboard
fn get_text(&mut self) -> Result<String, String>
fn set_text(&mut self, text: &str) -> Result<(), String>
fn has_text(&mut self) -> bool
Source§fn get_html(&mut self) -> Result<String, String>
fn get_html(&mut self) -> Result<String, String>
Read an HTML payload from the system clipboard. Backends without
HTML support return
Err("unsupported".into()); callers typically
check has_html first and fall back to get_text.Source§fn set_html(&mut self, html: &str, plain_fallback: &str) -> Result<(), String>
fn set_html(&mut self, html: &str, plain_fallback: &str) -> Result<(), String>
Write an HTML payload and a plain-text alternative onto the
clipboard in one transaction. Real platform clipboards demand
both so apps that only understand plain text still see the
copied content. Read more
Source§fn has_html(&mut self) -> bool
fn has_html(&mut self) -> bool
Whether the clipboard currently carries an HTML payload. Default
body returns
false; HTML-capable backends override to perform
a real probe. The probe may be expensive (X11 selection-owner
round-trip), so callers should invoke has_html only when
building menu state, not per-frame.Source§impl Debug for MemoryClipboard
impl Debug for MemoryClipboard
Source§impl Default for MemoryClipboard
impl Default for MemoryClipboard
Source§fn default() -> MemoryClipboard
fn default() -> MemoryClipboard
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryClipboard
impl RefUnwindSafe for MemoryClipboard
impl Send for MemoryClipboard
impl Sync for MemoryClipboard
impl Unpin for MemoryClipboard
impl UnsafeUnpin for MemoryClipboard
impl UnwindSafe for MemoryClipboard
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.