pub enum MarkdownEvent {
None,
FocusedLine {
line: usize,
},
HeadingToggled {
level: u8,
text: String,
collapsed: bool,
},
DoubleClick {
line_number: usize,
line_kind: String,
content: String,
},
Copied {
text: String,
},
SelectionStarted,
SelectionEnded,
Scrolled {
offset: usize,
direction: i32,
},
TocHoverChanged {
hovered: bool,
},
FilterModeChanged {
active: bool,
filter: String,
},
FilterModeExited {
line: usize,
},
}Available on crate feature
markdown-preview only.Expand description
Events emitted by the markdown widget. Events that can be emitted by the markdown widget.
The widget handles all internal state management and returns these events so the parent application can react appropriately (e.g., show toast messages).
Variants§
None
No event occurred.
FocusedLine
The focused line changed (via click or keyboard navigation).
HeadingToggled
A heading was toggled (collapsed/expanded).
Fields
DoubleClick
A double-click occurred on a line.
Fields
Copied
Text was copied to clipboard.
SelectionStarted
Selection mode was entered (drag started).
SelectionEnded
Selection mode was exited.
Scrolled
Content was scrolled.
Fields
TocHoverChanged
TOC hover state changed and should be redrawn.
FilterModeChanged
Filter mode changed (entered, text changed, or exited with Esc).
FilterModeExited
Filter mode exited via Enter (focuses the selected line).
Trait Implementations§
Source§impl Clone for MarkdownEvent
impl Clone for MarkdownEvent
Source§fn clone(&self) -> MarkdownEvent
fn clone(&self) -> MarkdownEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MarkdownEvent
impl RefUnwindSafe for MarkdownEvent
impl Send for MarkdownEvent
impl Sync for MarkdownEvent
impl Unpin for MarkdownEvent
impl UnsafeUnpin for MarkdownEvent
impl UnwindSafe for MarkdownEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more