pub struct DiffView<'a> { /* private fields */ }Expand description
A diff view. See the module docs.
Implementations§
Source§impl<'a> DiffView<'a>
impl<'a> DiffView<'a>
Sourcepub fn new(
id: &'a str,
state: &'a mut DiffViewState,
files: &'a [FileDiff],
revision: u64,
) -> Self
pub fn new( id: &'a str, state: &'a mut DiffViewState, files: &'a [FileDiff], revision: u64, ) -> Self
revision changes whenever files change (it keys every cache; expansions and the
selection reset when it changes).
pub fn mode(self, mode: DiffMode) -> Self
Sourcepub fn theme(self, theme: &'a SyntaxTheme) -> Self
pub fn theme(self, theme: &'a SyntaxTheme) -> Self
Syntax colours (default: SyntaxTheme::from_tokens).
pub fn labels(self, labels: &'a DiffLabels) -> Self
Sourcepub fn highlighter(self, h: &'a dyn Highlighter) -> Self
pub fn highlighter(self, h: &'a dyn Highlighter) -> Self
A different highlighting engine (default: Builtin).
Sourcepub fn max_height(self, h: f32) -> Self
pub fn max_height(self, h: f32) -> Self
Caps the view’s height (default: the available height).
pub fn show(self, ui: &mut Ui) -> DiffResponse
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DiffView<'a>
impl<'a> !Send for DiffView<'a>
impl<'a> !Sync for DiffView<'a>
impl<'a> !UnwindSafe for DiffView<'a>
impl<'a> Forget for DiffView<'a>
impl<'a> Freeze for DiffView<'a>
impl<'a> Move for DiffView<'a>
impl<'a> Unpin for DiffView<'a>
impl<'a> UnsafeUnpin for DiffView<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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