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 Forget for DiffAnnotation
impl Freeze for DiffAnnotationwhere
NonZero<u32>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Path> is !null: Freeze,
PhantomData<ArcInner<Path>>: Freeze,
*const str is !null: Freeze,
PhantomData<&'static str>: Freeze,
*const ArcInner<ElementId> is !null: Freeze,
PhantomData<ArcInner<ElementId>>: Freeze,
impl Move for DiffAnnotation
impl RefUnwindSafe for DiffAnnotation
impl Send for DiffAnnotation
impl Sync for DiffAnnotation
impl Unpin for DiffAnnotation
impl UnsafeUnpin for DiffAnnotationwhere
NonZeroU32Inner: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Path> is !null: UnsafeUnpin,
PhantomData<ArcInner<Path>>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const ArcInner<ElementId> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementId>>: UnsafeUnpin,
impl UnwindSafe for DiffAnnotationwhere
NonZero<u32>: UnwindSafe,
&'static str: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<Path>: UnwindSafe,
NonNull<str>: UnwindSafe,
Arc<ElementId>: UnwindSafe,
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