pub enum ClickEvent<V> {
OpenUrl {
url: HttpUrl,
},
OpenFile {
path: String,
},
RunCommand {
command: CommandString,
},
SuggestCommand {
command: CommandString,
},
ChangePage {
page: PositiveI32,
},
CopyToClipboard {
value: String,
},
ShowDialog {
dialog: DialogReference<V>,
},
Custom {
id: ResourceLocation,
payload: Option<V>,
},
}Expand description
An action performed when a styled component is clicked.
Variants§
OpenUrl
Opens an HTTP or HTTPS URL.
OpenFile
Opens a local file path on the client.
RunCommand
Runs a command.
Fields
§
command: CommandStringThe command to run.
SuggestCommand
Places a command into the client’s chat input.
Fields
§
command: CommandStringThe command to suggest.
ChangePage
Changes the current book page.
Fields
§
page: PositiveI32The one-based page number.
CopyToClipboard
Copies text to the system clipboard.
ShowDialog
Opens a dialog.
Fields
§
dialog: DialogReference<V>The dialog identifier or inline definition.
Custom
Performs a custom action identified by a resource location.
Fields
§
id: ResourceLocationThe custom action identifier.
Trait Implementations§
Source§impl<V: Clone> Clone for ClickEvent<V>
impl<V: Clone> Clone for ClickEvent<V>
Source§fn clone(&self) -> ClickEvent<V>
fn clone(&self) -> ClickEvent<V>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug> Debug for ClickEvent<V>
impl<V: Debug> Debug for ClickEvent<V>
Source§impl<'de, V> Deserialize<'de> for ClickEvent<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for ClickEvent<V>where
V: Deserialize<'de>,
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<V: PartialEq> PartialEq for ClickEvent<V>
impl<V: PartialEq> PartialEq for ClickEvent<V>
Source§impl<V> Serialize for ClickEvent<V>where
V: Serialize,
impl<V> Serialize for ClickEvent<V>where
V: Serialize,
impl<V: PartialEq> StructuralPartialEq for ClickEvent<V>
Auto Trait Implementations§
impl<V> Freeze for ClickEvent<V>where
V: Freeze,
impl<V> RefUnwindSafe for ClickEvent<V>where
V: RefUnwindSafe,
impl<V> Send for ClickEvent<V>where
V: Send,
impl<V> Sync for ClickEvent<V>where
V: Sync,
impl<V> Unpin for ClickEvent<V>where
V: Unpin,
impl<V> UnsafeUnpin for ClickEvent<V>where
V: UnsafeUnpin,
impl<V> UnwindSafe for ClickEvent<V>where
V: UnwindSafe + RefUnwindSafe,
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