pub struct MutationAnalyzer { /* private fields */ }Expand description
Mutation analyzer
Implementations§
Source§impl MutationAnalyzer
impl MutationAnalyzer
Sourcepub fn new() -> MutationAnalyzer
pub fn new() -> MutationAnalyzer
Create a new mutation analyzer
Sourcepub fn with_rules(self, rules: BehaviorRules) -> MutationAnalyzer
pub fn with_rules(self, rules: BehaviorRules) -> MutationAnalyzer
Create with behavior rules
Sourcepub async fn analyze_mutation(
&self,
current: &Value,
previous: Option<&Value>,
_context: &StatefulAiContext,
) -> Result<MutationAnalysis, Error>
pub async fn analyze_mutation( &self, current: &Value, previous: Option<&Value>, _context: &StatefulAiContext, ) -> Result<MutationAnalysis, Error>
Analyze mutation between current and previous request
Compares the current request with the previous request in the session to detect changes and identify potential validation issues.
Sourcepub async fn detect_validation_issues(
&self,
mutation: &MutationAnalysis,
) -> Result<Vec<ValidationIssue>, Error>
pub async fn detect_validation_issues( &self, mutation: &MutationAnalysis, ) -> Result<Vec<ValidationIssue>, Error>
Detect validation issues based on mutation and rules
Sourcepub fn infer_response_type(
&self,
mutation: &MutationAnalysis,
_context: &StatefulAiContext,
) -> ResponseType
pub fn infer_response_type( &self, mutation: &MutationAnalysis, _context: &StatefulAiContext, ) -> ResponseType
Infer response type from mutation analysis
Trait Implementations§
Source§impl Default for MutationAnalyzer
impl Default for MutationAnalyzer
Source§fn default() -> MutationAnalyzer
fn default() -> MutationAnalyzer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MutationAnalyzer
impl RefUnwindSafe for MutationAnalyzer
impl Send for MutationAnalyzer
impl Sync for MutationAnalyzer
impl Unpin for MutationAnalyzer
impl UnsafeUnpin for MutationAnalyzer
impl UnwindSafe for MutationAnalyzer
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
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