pub struct Suggestion {
pub target: String,
pub line: usize,
pub insertion_line: Option<usize>,
pub annotation_type: AnnotationType,
pub value: String,
pub source: SuggestionSource,
pub confidence: f32,
}Expand description
@acp:summary “A suggested annotation to add to a symbol or file” Represents a single annotation suggestion with its metadata.
Fields§
§target: StringTarget: file path for file-level, qualified_name for symbols
line: usizeLine number of the symbol (1-indexed)
insertion_line: Option<usize>Line number where annotation should be inserted (1-indexed)
This is before any decorators/attributes. Falls back to line if None.
annotation_type: AnnotationTypeThe annotation type (summary, domain, lock, etc.)
value: StringThe annotation value
source: SuggestionSourceSource of this suggestion (for conflict resolution)
confidence: f32Confidence score (0.0 - 1.0)
Implementations§
Source§impl Suggestion
impl Suggestion
Sourcepub fn new(
target: impl Into<String>,
line: usize,
annotation_type: AnnotationType,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn new( target: impl Into<String>, line: usize, annotation_type: AnnotationType, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a new suggestion”
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 be placed)”
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 summary(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn summary( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a summary annotation suggestion”
Sourcepub fn domain(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn domain( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a domain annotation suggestion”
Sourcepub fn lock(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn lock( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a lock annotation suggestion”
Sourcepub fn layer(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn layer( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a layer annotation suggestion”
Sourcepub fn module(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn module( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a module annotation suggestion”
Sourcepub fn deprecated(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn deprecated( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates a deprecated annotation suggestion”
Sourcepub fn ai_hint(
target: impl Into<String>,
line: usize,
value: impl Into<String>,
source: SuggestionSource,
) -> Self
pub fn ai_hint( target: impl Into<String>, line: usize, value: impl Into<String>, source: SuggestionSource, ) -> Self
@acp:summary “Creates an AI hint annotation suggestion”
Sourcepub fn with_confidence(self, confidence: f32) -> Self
pub fn with_confidence(self, confidence: f32) -> Self
@acp:summary “Sets the confidence score for this suggestion”
Sourcepub fn is_file_level(&self) -> bool
pub fn is_file_level(&self) -> bool
@acp:summary “Returns whether this is a file-level annotation”
Sourcepub fn to_annotation_string(&self) -> String
pub fn to_annotation_string(&self) -> String
@acp:summary “Formats the suggestion as an annotation string”
Sourcepub fn to_annotation_strings_with_provenance(
&self,
config: &ProvenanceConfig,
) -> Vec<String>
pub fn to_annotation_strings_with_provenance( &self, config: &ProvenanceConfig, ) -> Vec<String>
@acp:summary “Formats the suggestion with RFC-0003 provenance markers” Returns multiple annotation lines: the main annotation followed by provenance markers.
Trait Implementations§
Source§impl Clone for Suggestion
impl Clone for Suggestion
Source§fn clone(&self) -> Suggestion
fn clone(&self) -> Suggestion
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Suggestion
impl Debug for Suggestion
Source§impl<'de> Deserialize<'de> for Suggestion
impl<'de> Deserialize<'de> for Suggestion
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>,
Source§impl PartialEq for Suggestion
impl PartialEq for Suggestion
Source§impl Serialize for Suggestion
impl Serialize for Suggestion
impl StructuralPartialEq for Suggestion
Auto Trait Implementations§
impl Freeze for Suggestion
impl RefUnwindSafe for Suggestion
impl Send for Suggestion
impl Sync for Suggestion
impl Unpin for Suggestion
impl UnwindSafe for Suggestion
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