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
impl ReviewView
Sourcepub fn project(doc: &PlanDocument) -> Result<Self, EngineError>
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.
pub fn group_position(&self, id: &str) -> Option<usize>
Sourcepub fn group_of_hunk(&self, hunk: HunkId) -> Option<&GroupView>
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.
Sourcepub fn hunk_by_digest(&self, digest: &str) -> Option<HunkId>
pub fn hunk_by_digest(&self, digest: &str) -> Option<HunkId>
Findings anchor on digests, which survive regeneration where positional ids do not.
Sourcepub fn digest(&self, hunk: HunkId) -> &str
pub fn digest(&self, hunk: HunkId) -> &str
A hunk’s exact content digest — the reviewed-mark key.
Sourcepub fn hunks_marked<'k>(
&self,
marked: impl Fn(&str) -> bool + 'k,
) -> HashSet<HunkId>
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.
Sourcepub fn count_marked<'k>(&self, marked: impl Fn(&str) -> bool + 'k) -> usize
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.
Sourcepub fn class(&self, id: &str) -> &ClassMembers
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.
Sourcepub fn tier_name(&self, group: &GroupView) -> &'static str
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
impl Clone for ReviewView
Source§fn clone(&self) -> ReviewView
fn clone(&self) -> ReviewView
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReviewView
impl Debug for ReviewView
impl Eq for ReviewView
Source§impl PartialEq for ReviewView
impl PartialEq for ReviewView
impl StructuralPartialEq for ReviewView
Auto Trait Implementations§
impl Freeze for ReviewView
impl RefUnwindSafe for ReviewView
impl Send for ReviewView
impl Sync for ReviewView
impl Unpin for ReviewView
impl UnsafeUnpin for ReviewView
impl UnwindSafe for ReviewView
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.