pub struct MarkdownReviewState { /* private fields */ }Expand description
Persistent state for crate::MarkdownReviewWidget.
Implementations§
Source§impl MarkdownReviewState
impl MarkdownReviewState
pub fn interaction_phase(&self) -> InteractionPhase
pub fn handle_input( &mut self, input: ReviewInput, ) -> Result<InputOutcome<MarkdownReviewEvent>, MarkdownReviewError>
pub fn command_for_key(&self, key: KeyEvent) -> Option<MarkdownReviewCommand>
pub fn command_context(&self) -> CommandContext
pub fn set_capabilities(&mut self, capabilities: ReviewCapabilities)
pub fn command_enabled(&self, command: &MarkdownReviewCommand) -> bool
pub fn handle_command( &mut self, command: impl Into<MarkdownReviewCommand>, ) -> Result<InputOutcome<MarkdownReviewEvent>, MarkdownReviewError>
Source§impl MarkdownReviewState
impl MarkdownReviewState
Sourcepub fn new(document: Arc<MarkdownDocument>) -> Self
pub fn new(document: Arc<MarkdownDocument>) -> Self
Creates ready state from an immutable parsed document.
Sourcepub fn with_theme(document: Arc<MarkdownDocument>, theme: ReviewTheme) -> Self
pub fn with_theme(document: Arc<MarkdownDocument>, theme: ReviewTheme) -> Self
Creates state with an explicit shared neutral theme.
pub const fn session(&self) -> &MarkdownReviewSession
pub const fn session_mut(&mut self) -> &mut MarkdownReviewSession
pub const fn document(&self) -> &Arc<MarkdownDocument> ⓘ
pub const fn review(&self) -> &MarkdownReview
pub const fn review_mut(&mut self) -> &mut MarkdownReview
pub const fn selected_target(&self) -> Option<MarkdownTargetId>
pub const fn focus(&self) -> MarkdownFocusPane
pub const fn scroll_offset(&self) -> usize
pub const fn outline_scroll_offset(&self) -> usize
pub const fn cursor_position(&self) -> Option<Position>
pub const fn is_dirty(&self) -> bool
pub const fn mark_dirty(&mut self)
Sourcepub const fn theme(&self) -> &ReviewTheme
pub const fn theme(&self) -> &ReviewTheme
Returns the active renderer-neutral theme.
pub const fn highlight_stats(&self) -> HighlightStats
Sourcepub fn set_document(&mut self, document: Arc<MarkdownDocument>)
pub fn set_document(&mut self, document: Arc<MarkdownDocument>)
Replaces the parsed snapshot and reconciles all existing comments.
Sourcepub fn set_theme(&mut self, theme: ReviewTheme)
pub fn set_theme(&mut self, theme: ReviewTheme)
Changes the theme and invalidates syntax highlighting.
pub const fn options(&self) -> &ReviewOptions
pub fn keybindings(&self) -> &[KeyBinding<MarkdownReviewCommand>]
pub fn set_keybindings( &mut self, bindings: impl Into<Vec<KeyBinding<MarkdownReviewCommand>>>, )
pub fn set_options(&mut self, options: ReviewOptions)
pub fn theme_choices(&self) -> &[ThemeChoice]
pub fn set_theme_choices(&mut self, themes: impl Into<Arc<[ThemeChoice]>>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MarkdownReviewState
impl RefUnwindSafe for MarkdownReviewState
impl Send for MarkdownReviewState
impl Sync for MarkdownReviewState
impl Unpin for MarkdownReviewState
impl UnsafeUnpin for MarkdownReviewState
impl UnwindSafe for MarkdownReviewState
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> 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