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§impl Debug for DiffSnapshot
impl Debug for DiffSnapshot
Source§impl Default for DiffSnapshot
impl Default for DiffSnapshot
impl Eq for DiffSnapshot
Source§impl PartialEq for DiffSnapshot
impl PartialEq for DiffSnapshot
impl StructuralPartialEq for DiffSnapshot
Auto Trait Implementations§
impl Forget for DiffSnapshot
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