Skip to main content

ReviewView

Struct ReviewView 

Source
pub struct ReviewView {
    pub groups: Vec<GroupView>,
    pub files: Vec<FileView>,
    /* private fields */
}
Expand description

The projection. Owned, not borrowing the document, so a session can hold both without becoming self-referential.

Fields§

§groups: Vec<GroupView>§files: Vec<FileView>

Every file in the document, document order — including the zero-hunk binary, submodule and mode-only changes the group view cannot surface.

Implementations§

Source§

impl ReviewView

Source

pub fn project(doc: &PlanDocument) -> Result<Self, EngineError>

Project a document, validating it on the way through.

Needs no store and therefore no port: reviewed-mark keys are a pure function of the hunk digests the document already carries, which is why ReviewSession can stop computing its own copy of them.

Source

pub fn group_position(&self, id: &str) -> Option<usize>

Source

pub fn group_of_hunk(&self, hunk: HunkId) -> Option<&GroupView>

The group owning a hunk, via its class.

None only for a hunk whose class is in no group — impossible after the coverage audit, but the type says so rather than a comment.

Source

pub fn hunk_by_digest(&self, digest: &str) -> Option<HunkId>

Findings anchor on digests, which survive regeneration where positional ids do not.

Source

pub fn digest(&self, hunk: HunkId) -> &str

A hunk’s exact content digest — the reviewed-mark key.

Source

pub fn hunks_marked<'k>( &self, marked: impl Fn(&str) -> bool + 'k, ) -> HashSet<HunkId>

Every hunk whose digest is marked.

Walks the hunks rather than the marks, because a digest is content and content repeats: two byte-identical hunks carry one key, and marking either marks both. hunk_by_digest can only name one of them.

Source

pub fn count_marked<'k>(&self, marked: impl Fn(&str) -> bool + 'k) -> usize

How many hunks of THIS document are marked.

A count, not a set. The status bar prints this number every frame, and reaching it through hunks_marked allocated a whole HashSet to ask for its length — twice over, because the caller then rebuilt it as a set of indices.

Source

pub fn class(&self, id: &str) -> &ClassMembers

One class’s exemplar and members.

Total for any id a group names: PlanIndex::build proved every one of them resolves before this projection was made.

Source

pub fn tier_name(&self, group: &GroupView) -> &'static str

The tier’s domain name, or unclassified for the audit back-fill.

One answer for both renderers: the stack has always labelled the back-fill distinctly and the TUI has always shown it as an ordinary focus group, which is the same document described two ways.

Trait Implementations§

Source§

impl Clone for ReviewView

Source§

fn clone(&self) -> ReviewView

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 ReviewView

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ReviewView

Source§

impl PartialEq for ReviewView

Source§

fn eq(&self, other: &ReviewView) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ReviewView

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

Source§

type Output = T

Should always be Self
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.