pub struct PacedStreamingClient {
pub chunks: Vec<&'static str>,
pub gap: Duration,
}Available on crate feature
test-utils only.Expand description
A mock HTTP client whose send_streaming answers at once, then sends
each of chunks gap after the last, then holds the body open.
Fields§
§chunks: Vec<&'static str>The body’s chunks, in order.
gap: DurationThe wait before each chunk.
Trait Implementations§
Source§impl Clone for PacedStreamingClient
impl Clone for PacedStreamingClient
Source§impl Debug for PacedStreamingClient
impl Debug for PacedStreamingClient
Source§impl Default for PacedStreamingClient
impl Default for PacedStreamingClient
Source§impl HttpClientExt for PacedStreamingClient
impl HttpClientExt for PacedStreamingClient
Source§fn send<T, U>(
&self,
_req: Request<T>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
fn send<T, U>( &self, _req: Request<T>, ) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
Sends a request and returns headers with a lazy body converted from bytes to
U.Source§fn send_multipart<U>(
&self,
_req: Request<MultipartForm>,
) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
fn send_multipart<U>( &self, _req: Request<MultipartForm>, ) -> impl Future<Output = Result<Response<LazyBody<U>>>> + WasmCompatSend + 'static
Sends a multipart request and returns headers with a lazy body converted to
U.Source§fn send_streaming<T>(
&self,
_req: Request<T>,
) -> impl Future<Output = Result<StreamingResponse>> + WasmCompatSend
fn send_streaming<T>( &self, _req: Request<T>, ) -> impl Future<Output = Result<StreamingResponse>> + WasmCompatSend
Sends a request and returns headers with a stream of transport byte chunks.
Auto Trait Implementations§
impl Freeze for PacedStreamingClient
impl RefUnwindSafe for PacedStreamingClient
impl Send for PacedStreamingClient
impl Sync for PacedStreamingClient
impl Unpin for PacedStreamingClient
impl UnsafeUnpin for PacedStreamingClient
impl UnwindSafe for PacedStreamingClient
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