Skip to main content

ReviewState

Struct ReviewState 

Source
pub struct ReviewState {
    pub reviewed_hunks: BTreeSet<String>,
    pub cursor: Option<(String, usize)>,
    pub split_diff: Option<bool>,
    pub wrap: Option<bool>,
    pub file_view: bool,
}

Fields§

§reviewed_hunks: BTreeSet<String>

Hunk digests marked reviewed.

One key per hunk, not one per class. A class key made every mark in a class hostage to every other hunk in it: change one hunk of five and the four nobody touched went unread again.

A state file written before this field existed records reviewed_classes, which no longer loads — those keys are class hashes and cannot be read as hunk digests. The rest of the file (cursor, layout) is unaffected.

§cursor: Option<(String, usize)>

Resume position: (group id or file path, row offset) in the last-open plan — a group id in the semantic view, a file path in the file view.

§split_diff: Option<bool>

The reader’s diff-layout choice, or None if they have not made one.

None means “use the configured default” — which is why this is an option and not a bool. A state file written before this field existed records false, and that deserialises to Some(false): a review already on disk keeps the layout it had, whatever the config now says.

§wrap: Option<bool>

The reader’s soft-wrap choice, or None if they have not pressed w.

An option for the same reason split_diff is one: absent means the reader has never chosen, and the renderer’s own default stands.

§file_view: bool

Flattened per-file view instead of semantic groups (default: groups).

Trait Implementations§

Source§

impl Clone for ReviewState

Source§

fn clone(&self) -> Self

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 ReviewState

Source§

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

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

impl Default for ReviewState

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ReviewState

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for ReviewState

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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.