pub struct TurnBuilder { /* private fields */ }Expand description
Sub-builder configuring one turn of a conversation mock
(mirrors org.mockserver.client.TurnBuilder).
Implementations§
Source§impl TurnBuilder
impl TurnBuilder
Sourcepub fn when_turn_index(self, n: i64) -> Self
pub fn when_turn_index(self, n: i64) -> Self
Match when the conversation is at the given (0-based) turn index.
Sourcepub fn when_latest_message_contains(self, text: impl Into<String>) -> Self
pub fn when_latest_message_contains(self, text: impl Into<String>) -> Self
Match when the latest message contains the given substring.
Sourcepub fn when_latest_message_matches(self, regex: impl Into<String>) -> Self
pub fn when_latest_message_matches(self, regex: impl Into<String>) -> Self
Match when the latest message matches the given regex.
Sourcepub fn when_latest_message_role(self, role: impl Into<String>) -> Self
pub fn when_latest_message_role(self, role: impl Into<String>) -> Self
Match when the latest message has the given role (use a Role constant).
Sourcepub fn when_contains_tool_result_for(self, tool_name: impl Into<String>) -> Self
pub fn when_contains_tool_result_for(self, tool_name: impl Into<String>) -> Self
Match when the latest message contains a tool result for the given tool.
Sourcepub fn when_semantic_match(self, expected_meaning: impl Into<String>) -> Self
pub fn when_semantic_match(self, expected_meaning: impl Into<String>) -> Self
Match semantically against the given expected meaning.
Sourcepub fn with_normalization(self, normalization: Value) -> Self
pub fn with_normalization(self, normalization: Value) -> Self
Set normalization options (a JSON object). Not counted as a predicate.
Sourcepub fn with_chaos(self, chaos: Value) -> Self
pub fn with_chaos(self, chaos: Value) -> Self
Set a chaos profile (a JSON object) for this turn.
Sourcepub fn responding_with(self, completion: Completion) -> Self
pub fn responding_with(self, completion: Completion) -> Self
Set the completion this turn responds with.
Trait Implementations§
Source§impl Clone for TurnBuilder
impl Clone for TurnBuilder
Source§fn clone(&self) -> TurnBuilder
fn clone(&self) -> TurnBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TurnBuilder
impl Debug for TurnBuilder
Source§impl Default for TurnBuilder
impl Default for TurnBuilder
Source§fn default() -> TurnBuilder
fn default() -> TurnBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TurnBuilder
impl RefUnwindSafe for TurnBuilder
impl Send for TurnBuilder
impl Sync for TurnBuilder
impl Unpin for TurnBuilder
impl UnsafeUnpin for TurnBuilder
impl UnwindSafe for TurnBuilder
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