Skip to main content

ReviewSession

Struct ReviewSession 

Source
pub struct ReviewSession { /* private fields */ }

Implementations§

Source§

impl ReviewSession

Source

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

Source

pub fn with_options( document: Arc<DiffDocument>, options: SessionOptions, ) -> Self

Source

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

Source

pub const fn presentation(&self) -> &DiffPresentation

Source

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

Source

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

Source

pub const fn view_mode(&self) -> ViewMode

Source

pub const fn layout(&self) -> Layout

Source

pub fn selected_file(&self) -> Option<usize>

Source

pub fn selected_row(&self) -> Option<usize>

Source

pub const fn selected_side(&self) -> DiffSide

Source

pub fn selected_file_range(&self) -> Option<Range<usize>>

Source

pub const fn draft(&self) -> Option<&CommentDraft>

Source

pub const fn draft_mut(&mut self) -> Option<&mut CommentDraft>

Source

pub const fn projection_revision(&self) -> u64

Source

pub fn selected_source_line(&self) -> Option<SourceLocation>

Source

pub fn reveal_selected_gap(&mut self, amount: RevealAmount) -> bool

Source

pub fn toggle_full_file(&mut self) -> bool

Source

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

Replaces the complete immutable document while preserving review and view state, including gap expansions for files whose content did not change.

Source

pub fn set_view_mode(&mut self, mode: ViewMode) -> bool

Source

pub fn cycle_view_mode(&mut self) -> bool

Source

pub fn set_split_when_auto(&mut self, split: bool) -> bool

Source

pub fn clear_review(&mut self)

Source

pub fn select_file(&mut self, index: usize) -> bool

Source

pub fn move_file(&mut self, delta: isize) -> Option<usize>

Source

pub fn move_row(&mut self, delta: isize)

Source

pub fn select_boundary(&mut self, end: bool)

Source

pub fn select_row(&mut self, index: usize) -> bool

Source

pub fn hunk_target(&self, delta: isize) -> Option<usize>

Source

pub fn move_hunk(&mut self, delta: isize) -> bool

Source

pub fn set_selected_side(&mut self, side: DiffSide) -> bool

Source

pub fn selected_presented_row(&self) -> Option<&PresentedRow>

Source

pub fn selected_cell(&self) -> Option<&PresentedCell>

Source

pub fn selected_anchor(&self) -> Option<LineAnchor>

Source

pub fn comment_id_at_selection(&self) -> Option<u64>

Source

pub fn last_comment_id(&self) -> Option<u64>

Source

pub fn begin_draft(&mut self, editing: Option<u64>) -> bool

Source

pub fn edit_comment_at_selection(&mut self) -> bool

Source

pub fn undo_last_comment(&mut self) -> bool

Source

pub fn cancel_draft(&mut self)

Source

pub fn submit_draft(&mut self) -> Option<u64>

Source

pub fn delete_comment_at_selection(&mut self) -> bool

Source

pub fn submission(&self) -> ReviewSubmission

Trait Implementations§

Source§

impl Clone for ReviewSession

Source§

fn clone(&self) -> ReviewSession

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ReviewSession

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.