pub struct AnnotationGap {
pub target: String,
pub symbol_kind: Option<SymbolKind>,
pub line: usize,
pub insertion_line: Option<usize>,
pub missing: Vec<AnnotationType>,
pub doc_comment: Option<String>,
pub doc_comment_range: Option<(usize, usize)>,
pub is_exported: bool,
pub visibility: Option<Visibility>,
}Expand description
@acp:summary “A symbol or file lacking required annotations” Represents a gap in annotation coverage.
Fields§
§target: StringTarget symbol name or file path
symbol_kind: Option<SymbolKind>Symbol kind (None for file-level gaps)
line: usizeLine number of the symbol (1-indexed)
insertion_line: Option<usize>Line where annotation should be inserted (1-indexed)
This is before any decorators/attributes for the symbol.
Falls back to line if not set.
missing: Vec<AnnotationType>Which annotation types are missing
doc_comment: Option<String>Existing doc comment (if any) that could be converted
doc_comment_range: Option<(usize, usize)>Line range of existing doc comment (start, end) - 1-indexed
is_exported: boolWhether this is exported/public
visibility: Option<Visibility>Visibility of the symbol
Implementations§
Source§impl AnnotationGap
impl AnnotationGap
Sourcepub fn new(target: impl Into<String>, line: usize) -> Self
pub fn new(target: impl Into<String>, line: usize) -> Self
@acp:summary “Creates a new annotation gap”
Sourcepub fn with_symbol_kind(self, kind: SymbolKind) -> Self
pub fn with_symbol_kind(self, kind: SymbolKind) -> Self
@acp:summary “Sets the symbol kind”
Sourcepub fn with_insertion_line(self, line: usize) -> Self
pub fn with_insertion_line(self, line: usize) -> Self
@acp:summary “Sets the insertion line (where annotation should go)”
Sourcepub fn effective_insertion_line(&self) -> usize
pub fn effective_insertion_line(&self) -> usize
@acp:summary “Gets the effective insertion line (falls back to symbol line)”
Sourcepub fn with_doc_comment(self, doc: impl Into<String>) -> Self
pub fn with_doc_comment(self, doc: impl Into<String>) -> Self
@acp:summary “Sets the doc comment”
Sourcepub fn with_doc_comment_range(
self,
doc: impl Into<String>,
start: usize,
end: usize,
) -> Self
pub fn with_doc_comment_range( self, doc: impl Into<String>, start: usize, end: usize, ) -> Self
@acp:summary “Sets the doc comment with its line range”
Sourcepub fn with_visibility(self, visibility: Visibility) -> Self
pub fn with_visibility(self, visibility: Visibility) -> Self
@acp:summary “Sets the visibility of the symbol”
Sourcepub fn add_missing(&mut self, annotation_type: AnnotationType)
pub fn add_missing(&mut self, annotation_type: AnnotationType)
@acp:summary “Adds a missing annotation type”
Trait Implementations§
Source§impl Clone for AnnotationGap
impl Clone for AnnotationGap
Source§fn clone(&self) -> AnnotationGap
fn clone(&self) -> AnnotationGap
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AnnotationGap
impl Debug for AnnotationGap
Source§impl<'de> Deserialize<'de> for AnnotationGap
impl<'de> Deserialize<'de> for AnnotationGap
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for AnnotationGap
impl RefUnwindSafe for AnnotationGap
impl Send for AnnotationGap
impl Sync for AnnotationGap
impl Unpin for AnnotationGap
impl UnwindSafe for AnnotationGap
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
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>
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>
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