Skip to main content

MarkdownReviewState

Struct MarkdownReviewState 

Source
pub struct MarkdownReviewState { /* private fields */ }
Expand description

Persistent state for crate::MarkdownReviewWidget.

Implementations§

Source§

impl MarkdownReviewState

Source§

impl MarkdownReviewState

Source

pub fn new(document: Arc<MarkdownDocument>) -> Self

Creates ready state from an immutable parsed document.

Source

pub fn with_theme(document: Arc<MarkdownDocument>, theme: ReviewTheme) -> Self

Creates state with an explicit shared neutral theme.

Source

pub const fn session(&self) -> &MarkdownReviewSession

Source

pub const fn session_mut(&mut self) -> &mut MarkdownReviewSession

Source

pub const fn document(&self) -> &Arc<MarkdownDocument>

Source

pub const fn review(&self) -> &MarkdownReview

Source

pub const fn review_mut(&mut self) -> &mut MarkdownReview

Source

pub const fn selected_target(&self) -> Option<MarkdownTargetId>

Source

pub const fn focus(&self) -> MarkdownFocusPane

Source

pub const fn scroll_offset(&self) -> usize

Source

pub const fn outline_scroll_offset(&self) -> usize

Source

pub const fn cursor_position(&self) -> Option<Position>

Source

pub const fn is_dirty(&self) -> bool

Source

pub const fn mark_dirty(&mut self)

Source

pub const fn theme(&self) -> &ReviewTheme

Returns the active renderer-neutral theme.

Source

pub const fn highlight_stats(&self) -> HighlightStats

Source

pub fn set_document(&mut self, document: Arc<MarkdownDocument>)

Replaces the parsed snapshot and reconciles all existing comments.

Source

pub fn set_theme(&mut self, theme: ReviewTheme)

Source

pub const fn options(&self) -> &ReviewOptions

Source

pub fn keybindings(&self) -> &[KeyBinding<MarkdownReviewCommand>]

Source

pub fn set_keybindings( &mut self, bindings: impl Into<Vec<KeyBinding<MarkdownReviewCommand>>>, )

Source

pub fn set_options(&mut self, options: ReviewOptions)

Source

pub fn theme_choices(&self) -> &[ThemeChoice]

Source

pub fn set_theme_choices(&mut self, themes: impl Into<Arc<[ThemeChoice]>>)

Trait Implementations§

Source§

impl Debug for MarkdownReviewState

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.