pub struct InfiniteReader { /* private fields */ }Expand description
A(n) (in)finite random byte stream implementing AsyncRead.
Cheap to serve, expensive to download. Eat while it’s hot my dear little bots.
Implementations§
Source§impl InfiniteReader
impl InfiniteReader
Sourcepub fn new() -> InfiniteReader
pub fn new() -> InfiniteReader
Create an new default InfiniteReader.
Sourcepub fn maybe_with_throttle(self, delay: Option<Duration>) -> InfiniteReader
pub fn maybe_with_throttle(self, delay: Option<Duration>) -> InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn maybe_set_throttle(
&mut self,
delay: Option<Duration>,
) -> &mut InfiniteReader
pub fn maybe_set_throttle( &mut self, delay: Option<Duration>, ) -> &mut InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn with_throttle(self, delay: Duration) -> InfiniteReader
pub fn with_throttle(self, delay: Duration) -> InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn set_throttle(&mut self, delay: Duration) -> &mut InfiniteReader
pub fn set_throttle(&mut self, delay: Duration) -> &mut InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn without_throttle(self) -> InfiniteReader
pub fn without_throttle(self) -> InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn unset_throttle(&mut self) -> &mut InfiniteReader
pub fn unset_throttle(&mut self) -> &mut InfiniteReader
Define the max throttle to be used for the intervals.
Setting it will ensure that we have randomised throttles between reads, making it more effective.
Sourcepub fn maybe_with_size_limit(self, limit: Option<usize>) -> InfiniteReader
pub fn maybe_with_size_limit(self, limit: Option<usize>) -> InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn maybe_set_size_limit(
&mut self,
limit: Option<usize>,
) -> &mut InfiniteReader
pub fn maybe_set_size_limit( &mut self, limit: Option<usize>, ) -> &mut InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn with_size_limit(self, limit: usize) -> InfiniteReader
pub fn with_size_limit(self, limit: usize) -> InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn set_size_limit(&mut self, limit: usize) -> &mut InfiniteReader
pub fn set_size_limit(&mut self, limit: usize) -> &mut InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn without_size_limit(self) -> InfiniteReader
pub fn without_size_limit(self) -> InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn unset_size_limit(&mut self) -> &mut InfiniteReader
pub fn unset_size_limit(&mut self) -> &mut InfiniteReader
Set a limit on how much data will be served, by default it will be an infinite amount of data.
Sourcepub fn with_chunk_size(self, size: usize) -> InfiniteReader
pub fn with_chunk_size(self, size: usize) -> InfiniteReader
Define the chunk size for downloads.
The default value is used if a value of 0 is given.
Sourcepub fn set_chunk_size(&mut self, size: usize) -> &mut InfiniteReader
pub fn set_chunk_size(&mut self, size: usize) -> &mut InfiniteReader
Define the chunk size for downloads.
The default value is used if a value of 0 is given.
Sourcepub fn into_body(self) -> Body
pub fn into_body(self) -> Body
Turn this InfiniteReader into a Body.
Trait Implementations§
Source§impl AsyncRead for InfiniteReader
impl AsyncRead for InfiniteReader
Source§impl Default for InfiniteReader
impl Default for InfiniteReader
Source§fn default() -> InfiniteReader
fn default() -> InfiniteReader
Source§impl From<InfiniteReader> for Body
impl From<InfiniteReader> for Body
Source§fn from(reader: InfiniteReader) -> Body
fn from(reader: InfiniteReader) -> Body
Source§impl IntoResponse for InfiniteReader
impl IntoResponse for InfiniteReader
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for InfiniteReader
impl !UnwindSafe for InfiniteReader
impl Freeze for InfiniteReader
impl Send for InfiniteReader
impl Sync for InfiniteReader
impl Unpin for InfiniteReader
impl UnsafeUnpin for InfiniteReader
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<R> AsyncReadExt for R
impl<R> AsyncReadExt for R
Source§fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Read<'a, Self>where
Self: Unpin,
Source§fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
fn read_buf<'a, B>(&'a mut self, buf: &'a mut B) -> ReadBuf<'a, Self, B>
Source§fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
fn read_exact<'a>(&'a mut self, buf: &'a mut [u8]) -> ReadExact<'a, Self>where
Self: Unpin,
buf. Read moreSource§fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
Source§fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
Source§fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
Source§fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
Source§fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
Source§fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
Source§fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
Source§fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
Source§fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
Source§fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
Source§fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
Source§fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
Source§fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
Source§fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
Source§fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
Source§fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
Source§fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
Source§fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
Source§fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
Source§fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
Source§fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
Source§fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
Source§fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
fn read_to_end<'a>(&'a mut self, buf: &'a mut Vec<u8>) -> ReadToEnd<'a, Self>where
Self: Unpin,
buf. Read moreSource§impl<T> AsyncReadOwned for T
impl<T> AsyncReadOwned for T
Source§fn poll_read_owned<B>(
&mut self,
cx: &mut Context<'_>,
slot: &mut BufSlot<B>,
) -> Poll<Result<usize, Error>>where
B: IoBufMut,
fn poll_read_owned<B>(
&mut self,
cx: &mut Context<'_>,
slot: &mut BufSlot<B>,
) -> Poll<Result<usize, Error>>where
B: IoBufMut,
slot, returning
the bytes read (0 = EOF). The buffer is moved through the read op: Read moreSource§fn read_owned<B>(
&mut self,
buf: B,
) -> impl Future<Output = (Result<usize, Error>, B)> + Send
fn read_owned<B>( &mut self, buf: B, ) -> impl Future<Output = (Result<usize, Error>, B)> + Send
poll_read_owned:
move buf in, drive to completion, hand it back filled. Not a second
impl: every owned reader gets it for free, relays and read_exact_into
use it. Read moreSource§impl<B> BodyExtractExt for B
impl<B> BodyExtractExt for B
Source§async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Sync + Send>>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_string(self) -> Result<String, Box<dyn Error + Sync + Send>>
async fn try_into_string(self) -> Result<String, Box<dyn Error + Sync + Send>>
Source§async fn try_capture_json(
self,
selectors: impl IntoIterator<Item = JsonPath> + Send,
max_capture_bytes: usize,
) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Sync + Send>>
async fn try_capture_json( self, selectors: impl IntoIterator<Item = JsonPath> + Send, max_capture_bytes: usize, ) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Sync + Send>>
selectors while streaming over the body. Read moreSource§async fn try_into_json_with<T>(
self,
opts: CollectOptions,
) -> Result<T, CollectError>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json_with<T>(
self,
opts: CollectOptions,
) -> Result<T, CollectError>where
T: DeserializeOwned + Send + 'static,
Source§async fn try_into_string_with(
self,
opts: CollectOptions,
) -> Result<String, CollectError>
async fn try_into_string_with( self, opts: CollectOptions, ) -> Result<String, CollectError>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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