pub enum SelectionPayload {
Text(String),
Image {
handle: ImageHandle,
region: Option<Rect>,
},
Custom {
kind: Arc<str>,
data: Arc<dyn Any + Send + Sync>,
},
}Variants§
Implementations§
Source§impl SelectionPayload
impl SelectionPayload
pub fn text(text: impl Into<String>) -> Self
pub fn image(handle: ImageHandle) -> Self
pub fn image_region(handle: ImageHandle, region: Rect) -> Self
pub fn custom<T>(kind: impl Into<Arc<str>>, data: T) -> Self
pub fn as_text(&self) -> Option<&str>
pub fn custom_kind(&self) -> Option<&str>
pub fn custom_data<T>(&self) -> Option<&T>
Trait Implementations§
Source§impl Clone for SelectionPayload
impl Clone for SelectionPayload
Auto Trait Implementations§
impl !RefUnwindSafe for SelectionPayload
impl !UnwindSafe for SelectionPayload
impl Forget for SelectionPayload
impl Freeze for SelectionPayload
impl Move for SelectionPayload
impl Send for SelectionPayload
impl Sync for SelectionPayload
impl Unpin for SelectionPayload
impl UnsafeUnpin for SelectionPayload
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