pub struct PatchView { /* private fields */ }Expand description
A review-style rendering of a Patch: a file tree with per-file
counts, then each file’s header and highlighted hunks, with annotations
under their lines and a changed-line summary at the end.
Implementations§
Source§impl PatchView
impl PatchView
pub fn new(patch: Patch) -> Self
Sourcepub fn annotate(self, annotation: Annotation) -> Self
pub fn annotate(self, annotation: Annotation) -> Self
Show annotation under its line.
Sourcepub fn annotations(
self,
annotations: impl IntoIterator<Item = Annotation>,
) -> Self
pub fn annotations( self, annotations: impl IntoIterator<Item = Annotation>, ) -> Self
Show every annotation under its line.
Sourcepub fn links(self, provider: impl LinkProvider + 'static) -> Self
pub fn links(self, provider: impl LinkProvider + 'static) -> Self
Link paths and new-side line numbers.
pub fn layout(self, layout: Layout) -> Self
pub fn line_numbers(self, show: bool) -> Self
pub fn wrap(self, wrap: bool) -> Self
Trait Implementations§
Source§impl Renderable for PatchView
impl Renderable for PatchView
fn rich_render( &self, console: &Console, options: &ConsoleOptions, ) -> Vec<Segment>
Source§fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
fn measure(&self, _console: &Console, options: &ConsoleOptions) -> Measurement
The
(minimum, maximum) cell width this renderable wants. The default
assumes the renderable fills the available width (e.g. Panel, Table);
Text overrides it with its content width so the top-level print path can
shrink to fit. Port of __rich_measure__ / Measurement.get.Source§fn fit_to_measurement(&self) -> bool
fn fit_to_measurement(&self) -> bool
Whether a top-level
Console::print shrinks this renderable to its
measured width. Upstream renders every top-level renderable at the full
console width, so the default is false; an extension may opt in.Auto Trait Implementations§
impl !RefUnwindSafe for PatchView
impl !UnwindSafe for PatchView
impl Freeze for PatchView
impl Send for PatchView
impl Sync for PatchView
impl Unpin for PatchView
impl UnsafeUnpin for PatchView
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