pub struct ForwardChainExpectation<'a> { /* private fields */ }Expand description
Fluent builder for creating an expectation via client.when(...).respond(...).
Implementations§
Source§impl<'a> ForwardChainExpectation<'a>
impl<'a> ForwardChainExpectation<'a>
Sourcepub fn time_to_live(self, ttl: TimeToLive) -> Self
pub fn time_to_live(self, ttl: TimeToLive) -> Self
Set the time-to-live for this expectation.
Sourcepub fn with_id(self, id: impl Into<String>) -> Self
pub fn with_id(self, id: impl Into<String>) -> Self
Set the expectation ID (for upsert semantics).
Sourcepub fn respond(self, response: HttpResponse) -> Result<Vec<Expectation>>
pub fn respond(self, response: HttpResponse) -> Result<Vec<Expectation>>
Complete the expectation with a response action.
Sourcepub fn forward(self, forward: HttpForward) -> Result<Vec<Expectation>>
pub fn forward(self, forward: HttpForward) -> Result<Vec<Expectation>>
Complete the expectation with a forward action.
Sourcepub fn error(self, error: HttpError) -> Result<Vec<Expectation>>
pub fn error(self, error: HttpError) -> Result<Vec<Expectation>>
Complete the expectation with an error action.
Sourcepub fn respond_sse(self, sse: HttpSseResponse) -> Result<Vec<Expectation>>
pub fn respond_sse(self, sse: HttpSseResponse) -> Result<Vec<Expectation>>
Complete the expectation with a Server-Sent Events (SSE) response action.
Sourcepub fn respond_web_socket(
self,
ws: HttpWebSocketResponse,
) -> Result<Vec<Expectation>>
pub fn respond_web_socket( self, ws: HttpWebSocketResponse, ) -> Result<Vec<Expectation>>
Complete the expectation with a WebSocket response action.
Sourcepub fn respond_dns(self, dns: DnsResponse) -> Result<Vec<Expectation>>
pub fn respond_dns(self, dns: DnsResponse) -> Result<Vec<Expectation>>
Complete the expectation with a DNS response action.
Sourcepub fn respond_binary(self, binary: BinaryResponse) -> Result<Vec<Expectation>>
pub fn respond_binary(self, binary: BinaryResponse) -> Result<Vec<Expectation>>
Complete the expectation with a raw binary response action.
Sourcepub fn respond_grpc_stream(
self,
grpc: GrpcStreamResponse,
) -> Result<Vec<Expectation>>
pub fn respond_grpc_stream( self, grpc: GrpcStreamResponse, ) -> Result<Vec<Expectation>>
Complete the expectation with a gRPC streaming response action.
Sourcepub fn respond_with_sse(self, sse: HttpSseResponse) -> Result<Vec<Expectation>>
pub fn respond_with_sse(self, sse: HttpSseResponse) -> Result<Vec<Expectation>>
Alias of respond_sse for cross-client naming parity.
Sourcepub fn respond_with_web_socket(
self,
ws: HttpWebSocketResponse,
) -> Result<Vec<Expectation>>
pub fn respond_with_web_socket( self, ws: HttpWebSocketResponse, ) -> Result<Vec<Expectation>>
Alias of respond_web_socket for cross-client naming parity.
Sourcepub fn respond_with_dns(self, dns: DnsResponse) -> Result<Vec<Expectation>>
pub fn respond_with_dns(self, dns: DnsResponse) -> Result<Vec<Expectation>>
Alias of respond_dns for cross-client naming parity.
Sourcepub fn respond_with_binary(
self,
binary: BinaryResponse,
) -> Result<Vec<Expectation>>
pub fn respond_with_binary( self, binary: BinaryResponse, ) -> Result<Vec<Expectation>>
Alias of respond_binary for cross-client naming parity.
Sourcepub fn respond_with_grpc_stream(
self,
grpc: GrpcStreamResponse,
) -> Result<Vec<Expectation>>
pub fn respond_with_grpc_stream( self, grpc: GrpcStreamResponse, ) -> Result<Vec<Expectation>>
Alias of respond_grpc_stream for cross-client naming parity.