pub struct MemoryClipboard { /* private fields */ }Expand description
In-memory clipboard for tests and headless runs.
Cloning is intentionally unsupported; share it behind an Rc when needed.
Reads and writes use a RefCell, so reentrant conflicting access panics.
New/default instances contain available empty text (Some("")).
§Examples
use ailloli_ui_runtime::app::{ClipboardProvider, MemoryClipboard};
let clipboard = MemoryClipboard::default();
assert_eq!(clipboard.read_text().unwrap(), "");Implementations§
Source§impl MemoryClipboard
Constructors for the deterministic memory clipboard.
impl MemoryClipboard
Constructors for the deterministic memory clipboard.
Trait Implementations§
Source§impl ClipboardProvider for MemoryClipboard
Provides infallible, UI-thread-local text storage.
impl ClipboardProvider for MemoryClipboard
Provides infallible, UI-thread-local text storage.
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 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