pub struct DiffSnapshot { /* private fields */ }Expand description
A rendered jj diff view for one change.
Implementations§
Source§impl DiffSnapshot
impl DiffSnapshot
Sourcepub fn new(change_id: impl Into<String>, rendered: impl Into<String>) -> Self
pub fn new(change_id: impl Into<String>, rendered: impl Into<String>) -> Self
Creates a diff snapshot from the target change and rendered terminal text.
Sourcepub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_title(self, title: impl Into<String>) -> Self
Sets the command context shown in the title bar.
Sourcepub fn with_file_stats(self, file_stats: Vec<DiffFileStat>) -> Self
pub fn with_file_stats(self, file_stats: Vec<DiffFileStat>) -> Self
Sets per-file line counts for the rendered diff.
Sourcepub fn file_stats(&self) -> &[DiffFileStat]
pub fn file_stats(&self) -> &[DiffFileStat]
Returns per-file line counts for changed files.
Sourcepub fn into_parts(self) -> (String, String, String, Vec<DiffFileStat>)
pub fn into_parts(self) -> (String, String, String, Vec<DiffFileStat>)
Consumes the snapshot into its owned title, target change, and rendered body.
Trait Implementations§
Source§impl Clone for DiffSnapshot
impl Clone for DiffSnapshot
Source§fn clone(&self) -> DiffSnapshot
fn clone(&self) -> DiffSnapshot
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiffSnapshot
impl Debug for DiffSnapshot
Source§impl Default for DiffSnapshot
impl Default for DiffSnapshot
Source§fn default() -> DiffSnapshot
fn default() -> DiffSnapshot
Returns the “default value” for a type. Read more
impl Eq for DiffSnapshot
Source§impl PartialEq for DiffSnapshot
impl PartialEq for DiffSnapshot
Source§fn eq(&self, other: &DiffSnapshot) -> bool
fn eq(&self, other: &DiffSnapshot) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DiffSnapshot
Auto Trait Implementations§
impl Freeze for DiffSnapshot
impl RefUnwindSafe for DiffSnapshot
impl Send for DiffSnapshot
impl Sync for DiffSnapshot
impl Unpin for DiffSnapshot
impl UnsafeUnpin for DiffSnapshot
impl UnwindSafe for DiffSnapshot
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
Mutably borrows from an owned value. Read more