pub struct DiffAnnotation { /* private fields */ }Expand description
Application-owned content attached to a source line or to a whole file.
The stable ID belongs to the annotation itself, while the target uses the file path and, for a line, its side and one-based source line, independent of folding.
Implementations§
Source§impl DiffAnnotation
impl DiffAnnotation
Sourcepub fn line(id: impl Into<ElementId>, position: DiffLinePosition) -> Self
pub fn line(id: impl Into<ElementId>, position: DiffLinePosition) -> Self
Attaches content beneath a source line.
Sourcepub fn file(id: impl Into<ElementId>, path: impl Into<SharedString>) -> Self
pub fn file(id: impl Into<ElementId>, path: impl Into<SharedString>) -> Self
Attaches content beneath the header of the file at path.
pub fn id(&self) -> &ElementId
Sourcepub fn path(&self) -> &SharedString
pub fn path(&self) -> &SharedString
The DiffFile::path of the annotated file.
Sourcepub fn position(&self) -> Option<&DiffLinePosition>
pub fn position(&self) -> Option<&DiffLinePosition>
The annotated line, or None for a file annotation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DiffAnnotation
impl RefUnwindSafe for DiffAnnotation
impl Send for DiffAnnotation
impl Sync for DiffAnnotation
impl Unpin for DiffAnnotation
impl UnsafeUnpin for DiffAnnotation
impl UnwindSafe for DiffAnnotation
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,
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