pub struct ComprehensiveToolOutput<T> {
pub result: T,
pub context: OperationContext,
pub changes: Vec<Change>,
pub metadata: OperationMetadata,
pub summary: String,
pub performance: PerformanceMetrics,
pub diagnostics: Vec<Diagnostic>,
}Expand description
Primary comprehensive output structure for all AGCodex tools
This provides a unified, context-rich structure that enhances the simpler tool-specific output implementations with comprehensive information about tool operations.
Fields§
§result: TThe primary result of the tool operation
context: OperationContextRich contextual information about the operation
changes: Vec<Change>All changes made during the operation
metadata: OperationMetadataComprehensive metadata about the operation
summary: StringHuman-readable summary optimized for LLM consumption
performance: PerformanceMetricsPerformance and execution metrics
diagnostics: Vec<Diagnostic>Warnings, errors, or other diagnostic information
Implementations§
Source§impl<T> ComprehensiveToolOutput<T>
impl<T> ComprehensiveToolOutput<T>
Sourcepub fn new(
result: T,
tool: &str,
operation: String,
location: SourceLocation,
) -> Self
pub fn new( result: T, tool: &str, operation: String, location: SourceLocation, ) -> Self
Create a new ComprehensiveToolOutput with minimal required fields
Sourcepub fn add_change(self, change: Change) -> Self
pub fn add_change(self, change: Change) -> Self
Add a change to the output
Sourcepub fn add_changes(self, changes: Vec<Change>) -> Self
pub fn add_changes(self, changes: Vec<Change>) -> Self
Add multiple changes to the output
Sourcepub fn add_diagnostic(self, diagnostic: Diagnostic) -> Self
pub fn add_diagnostic(self, diagnostic: Diagnostic) -> Self
Add a diagnostic message
Sourcepub fn with_summary(self, summary: String) -> Self
pub fn with_summary(self, summary: String) -> Self
Set the summary
Sourcepub const fn with_confidence(self, confidence: f32) -> Self
pub const fn with_confidence(self, confidence: f32) -> Self
Set the confidence level
Sourcepub fn has_errors(&self) -> bool
pub fn has_errors(&self) -> bool
Check if the operation had any errors
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Check if the operation had any warnings
Sourcepub fn max_impact_level(&self) -> ImpactLevel
pub fn max_impact_level(&self) -> ImpactLevel
Get the highest impact level of all changes
Trait Implementations§
Source§impl<T: Clone> Clone for ComprehensiveToolOutput<T>
impl<T: Clone> Clone for ComprehensiveToolOutput<T>
Source§fn clone(&self) -> ComprehensiveToolOutput<T>
fn clone(&self) -> ComprehensiveToolOutput<T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<T: Debug> Debug for ComprehensiveToolOutput<T>
impl<T: Debug> Debug for ComprehensiveToolOutput<T>
Source§impl<'de, T> Deserialize<'de> for ComprehensiveToolOutput<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for ComprehensiveToolOutput<T>where
T: Deserialize<'de>,
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<T> Freeze for ComprehensiveToolOutput<T>where
T: Freeze,
impl<T> RefUnwindSafe for ComprehensiveToolOutput<T>where
T: RefUnwindSafe,
impl<T> Send for ComprehensiveToolOutput<T>where
T: Send,
impl<T> Sync for ComprehensiveToolOutput<T>where
T: Sync,
impl<T> Unpin for ComprehensiveToolOutput<T>where
T: Unpin,
impl<T> UnwindSafe for ComprehensiveToolOutput<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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