pub struct DiffDecoration { /* private fields */ }Expand description
A background that marks source lines in place, without changing the selection, copying or layout.
Decorations paint above the change background and below inline emphasis, search highlights and text; a selected line shows the selection instead. Where several decorations cover a line, the last supplied one is shown.
Implementations§
Source§impl DiffDecoration
impl DiffDecoration
Sourcepub fn new(range: DiffLineRange) -> Self
pub fn new(range: DiffLineRange) -> Self
Marks the lines of range.
A range that ends on the other side covers its start side from
start onwards and its end side up to end.
Sourcepub fn with_background(self, background: impl Into<Hsla>) -> Self
pub fn with_background(self, background: impl Into<Hsla>) -> Self
Sets the background, which defaults to a translucent warning color.
pub fn range(&self) -> &DiffLineRange
Sourcepub fn background(&self) -> Option<Hsla>
pub fn background(&self) -> Option<Hsla>
The background set with Self::with_background.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiffDecoration
impl RefUnwindSafe for DiffDecoration
impl Send for DiffDecoration
impl Sync for DiffDecoration
impl Unpin for DiffDecoration
impl UnsafeUnpin for DiffDecoration
impl UnwindSafe for DiffDecoration
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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