Skip to main content

Review

Struct Review 

Source
pub struct Review {
    pub repo_root: PathBuf,
    pub vcs: Box<dyn Vcs>,
    pub status: StatusModel,
    pub session: Session,
    /* private fields */
}

Fields§

§repo_root: PathBuf§vcs: Box<dyn Vcs>§status: StatusModel§session: Session

The working-tree review session, the default view.

Implementations§

Source§

impl Review

Source

pub fn open(repo_root: &Path) -> Result<Self, ReviewError>

Open the git backend, load the persisted session (if any), and compute the status sections. The working-tree review diff is deferred until first Review::model access. Diffs carry git’s default hunk context.

Source

pub fn open_with_context( repo_root: &Path, context_lines: u32, ) -> Result<Self, ReviewError>

Like Review::open with a custom number of context lines around diff hunks (config key ui.context_lines).

Source

pub fn model(&self) -> &DiffModel

The working-tree review diff, computed and cached on first access. A backend error yields an empty diff rather than panicking; the next Review::refresh gets another chance to compute it.

Source

pub fn model_mut(&mut self) -> &mut DiffModel

Mutable view of the working-tree review diff, computing it first if needed. The TUI uses this to enrich a file with intra-line emphasis just before rendering it.

Source

pub fn refresh(&mut self) -> Result<(), ReviewError>

Recompute status + diff (the watcher calls this on changes) and drop viewed marks for files that changed or left the diff.

Source

pub fn save(&self) -> Result<(), ReviewError>

Source

pub fn ensure_source( &mut self, source: &ReviewSource, ) -> Result<(), ReviewError>

Load a non-working source’s session into the cache if not already there. Call before reading via Review::session_for for that source.

Source

pub fn session_for(&self, source: &ReviewSource) -> &Session

The session for a source. The working tree is always present; other sources must be Review::ensure_sourced first, else an empty session is returned.

Source

pub fn session_for_mut(&mut self, source: &ReviewSource) -> &mut Session

Source

pub fn save_for(&self, source: &ReviewSource) -> Result<(), ReviewError>

Source

pub fn all_reviews(&self) -> Result<Vec<(ReviewSource, Session)>, ReviewError>

Every review across all sources, in-memory state overriding disk, sorted by source key. Powers the agent-facing aggregate feed.

Auto Trait Implementations§

§

impl !Freeze for Review

§

impl !RefUnwindSafe for Review

§

impl !Sync for Review

§

impl !UnwindSafe for Review

§

impl Send for Review

§

impl Unpin for Review

§

impl UnsafeUnpin for Review

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.