pub struct DiffViewer;Expand description
A diff viewer component for unified and side-by-side diff display.
Displays text diffs with hunk navigation and line-level highlighting. Supports unified and side-by-side display modes.
§Key Bindings
Up/k– Scroll up one lineDown/j– Scroll down one linen– Jump to next hunkN/p– Jump to previous hunkPageUp/Ctrl+u– Scroll up half a pagePageDown/Ctrl+d– Scroll down half a pageHome/g– Scroll to topEnd/G– Scroll to bottomm– Toggle between unified and side-by-side mode
Trait Implementations§
Source§impl Component for DiffViewer
impl Component for DiffViewer
Source§type State = DiffViewerState
type State = DiffViewerState
The component’s internal state type. Read more
Source§type Message = DiffViewerMessage
type Message = DiffViewerMessage
Messages this component can receive. Read more
Source§type Output = DiffViewerOutput
type Output = DiffViewerOutput
Messages this component can emit to its parent. Read more
Source§fn handle_event(
_state: &Self::State,
event: &Event,
ctx: &ViewContext,
) -> Option<Self::Message>
fn handle_event( _state: &Self::State, event: &Event, ctx: &ViewContext, ) -> Option<Self::Message>
Maps an input event to a component message. Read more
Source§fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
fn update(state: &mut Self::State, msg: Self::Message) -> Option<Self::Output>
Update component state based on a message. Read more
Source§fn view(
state: &Self::State,
frame: &mut Frame<'_>,
area: Rect,
theme: &Theme,
ctx: &ViewContext,
)
fn view( state: &Self::State, frame: &mut Frame<'_>, area: Rect, theme: &Theme, ctx: &ViewContext, )
Render the component to the given area. Read more
Source§fn traced_view(
state: &Self::State,
frame: &mut Frame<'_>,
area: Rect,
theme: &Theme,
ctx: &ViewContext,
)
fn traced_view( state: &Self::State, frame: &mut Frame<'_>, area: Rect, theme: &Theme, ctx: &ViewContext, )
Renders the component with optional tracing instrumentation. Read more
Source§fn dispatch_event(
state: &mut Self::State,
event: &Event,
ctx: &ViewContext,
) -> Option<Self::Output>
fn dispatch_event( state: &mut Self::State, event: &Event, ctx: &ViewContext, ) -> Option<Self::Output>
Dispatches an event by mapping it to a message and updating state. Read more
Auto Trait Implementations§
impl Freeze for DiffViewer
impl RefUnwindSafe for DiffViewer
impl Send for DiffViewer
impl Sync for DiffViewer
impl Unpin for DiffViewer
impl UnsafeUnpin for DiffViewer
impl UnwindSafe for DiffViewer
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more