pub struct UseClipboard {
pub status: Signal<UseClipboardStatus>,
}Expand description
Reactive state for the clipboard.
The handle carries the outcome of the last write. The write itself is asynchronous — the browser answers a promise — so the status is the reactive part.
Fields§
§status: Signal<UseClipboardStatus>The outcome of the last write.
Implementations§
Source§impl UseClipboard
Inherent implementation of UseClipboard.
impl UseClipboard
Inherent implementation of UseClipboard.
Sourcepub fn current_status(&self) -> UseClipboardStatus
pub fn current_status(&self) -> UseClipboardStatus
Returns the current status as a snapshot.
§Returns
UseClipboardStatus- The outcome of the last write.
Sourcepub fn copy(&self, text: &str) -> bool
pub fn copy(&self, text: &str) -> bool
Copies text to the clipboard.
The write is asynchronous: this call starts it and returns
whether the browser accepted the request. The status settles
once the browser has answered, so a render closure that reads
get_status() shows the result.
§Arguments
&str- The text to copy.
§Returns
bool-truewhen the write was started.
Source§impl UseClipboard
impl UseClipboard
pub fn get_status(&self) -> Signal<UseClipboardStatus>
pub fn get_mut_status(&mut self) -> &mut Signal<UseClipboardStatus>
pub fn set_status(&mut self, val: Signal<UseClipboardStatus>) -> &mut Self
Trait Implementations§
Source§impl Clone for UseClipboard
impl Clone for UseClipboard
Source§impl Debug for UseClipboard
impl Debug for UseClipboard
Auto Trait Implementations§
impl Freeze for UseClipboard
impl RefUnwindSafe for UseClipboard
impl Send for UseClipboard
impl Sync for UseClipboard
impl Unpin for UseClipboard
impl UnsafeUnpin for UseClipboard
impl UnwindSafe for UseClipboard
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