pub struct MarkdownReviewState { /* private fields */ }Expand description
Persistent state for crate::MarkdownReviewWidget.
Implementations§
Source§impl MarkdownReviewState
impl MarkdownReviewState
Sourcepub fn handle_input(
&mut self,
input: MarkdownReviewInput,
) -> Result<Option<MarkdownReviewEvent>, MarkdownReviewError>
pub fn handle_input( &mut self, input: MarkdownReviewInput, ) -> Result<Option<MarkdownReviewEvent>, MarkdownReviewError>
Applies one input event.
§Errors
Returns MarkdownReviewError::BlankComment when an approval or
request-changes action encounters a blank comment body.
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: DiffTheme) -> Self
pub fn with_theme(document: Arc<MarkdownDocument>, theme: DiffTheme) -> 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)
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.
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