Struct InfiniteReader
pub struct InfiniteReader { /* private fields */ }http and std only.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§
§impl InfiniteReader
impl InfiniteReader
pub fn new() -> InfiniteReader
pub fn new() -> InfiniteReader
Create an new default InfiniteReader.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub fn into_body(self) -> Body
pub fn into_body(self) -> Body
Turn this InfiniteReader into a Body.
Trait Implementations§
§impl AsyncRead for InfiniteReader
impl AsyncRead for InfiniteReader
§impl Default for InfiniteReader
impl Default for InfiniteReader
§fn default() -> InfiniteReader
fn default() -> InfiniteReader
§impl From<InfiniteReader> for Body
impl From<InfiniteReader> for Body
§fn from(reader: InfiniteReader) -> Body
fn from(reader: InfiniteReader) -> Body
§impl IntoResponse for InfiniteReader
impl IntoResponse for InfiniteReader
§fn into_response(self) -> Response
fn into_response(self) -> Response
Auto Trait Implementations§
impl !RefUnwindSafe for InfiniteReader
impl !UnwindSafe for InfiniteReader
impl Forget for InfiniteReader
impl Freeze for InfiniteReader
impl Move for InfiniteReader
impl Send for InfiniteReaderwhere
BoxRaw<Sleep>: Send,
impl Sync for InfiniteReaderwhere
BoxRaw<Sleep>: Sync,
impl Unpin for InfiniteReader
impl UnsafeUnpin for InfiniteReader
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
impl<R> AsyncReadExt for Rwhere
R: AsyncRead + ?Sized,
§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,
§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>
§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 more§fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
fn read_u8(&mut self) -> ReadU8<&mut Self>where
Self: Unpin,
§fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
fn read_i8(&mut self) -> ReadI8<&mut Self>where
Self: Unpin,
§fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
fn read_u16(&mut self) -> ReadU16<&mut Self>where
Self: Unpin,
§fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
fn read_i16(&mut self) -> ReadI16<&mut Self>where
Self: Unpin,
§fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
fn read_u32(&mut self) -> ReadU32<&mut Self>where
Self: Unpin,
§fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
fn read_i32(&mut self) -> ReadI32<&mut Self>where
Self: Unpin,
§fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
fn read_u64(&mut self) -> ReadU64<&mut Self>where
Self: Unpin,
§fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
fn read_i64(&mut self) -> ReadI64<&mut Self>where
Self: Unpin,
§fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
fn read_u128(&mut self) -> ReadU128<&mut Self>where
Self: Unpin,
§fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
fn read_i128(&mut self) -> ReadI128<&mut Self>where
Self: Unpin,
§fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
fn read_f32(&mut self) -> ReadF32<&mut Self>where
Self: Unpin,
§fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
fn read_f64(&mut self) -> ReadF64<&mut Self>where
Self: Unpin,
§fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
fn read_u16_le(&mut self) -> ReadU16Le<&mut Self>where
Self: Unpin,
§fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
fn read_i16_le(&mut self) -> ReadI16Le<&mut Self>where
Self: Unpin,
§fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
fn read_u32_le(&mut self) -> ReadU32Le<&mut Self>where
Self: Unpin,
§fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
fn read_i32_le(&mut self) -> ReadI32Le<&mut Self>where
Self: Unpin,
§fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
fn read_u64_le(&mut self) -> ReadU64Le<&mut Self>where
Self: Unpin,
§fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
fn read_i64_le(&mut self) -> ReadI64Le<&mut Self>where
Self: Unpin,
§fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
fn read_u128_le(&mut self) -> ReadU128Le<&mut Self>where
Self: Unpin,
§fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
fn read_i128_le(&mut self) -> ReadI128Le<&mut Self>where
Self: Unpin,
§fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
fn read_f32_le(&mut self) -> ReadF32Le<&mut Self>where
Self: Unpin,
§fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
fn read_f64_le(&mut self) -> ReadF64Le<&mut Self>where
Self: Unpin,
§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 more§fn read_to_string<'a>(
&'a mut self,
dst: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
fn read_to_string<'a>(
&'a mut self,
dst: &'a mut String,
) -> ReadToString<'a, Self>where
Self: Unpin,
buf. Read more§impl<T> AsyncReadOwned for T
impl<T> AsyncReadOwned for T
§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 more§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 more§impl<B> BodyExtractExt for B
impl<B> BodyExtractExt for B
§async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Send + Sync>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json<T>(self) -> Result<T, Box<dyn Error + Send + Sync>>where
T: DeserializeOwned + Send + 'static,
§async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Send + Sync>>where
T: DeserializeOwned + Send + 'static,
async fn try_into_json_streaming<T>(
self,
) -> Result<T, Box<dyn Error + Send + Sync>>where
T: DeserializeOwned + Send + 'static,
§async fn try_into_string(self) -> Result<String, Box<dyn Error + Send + Sync>>
async fn try_into_string(self) -> Result<String, Box<dyn Error + Send + Sync>>
§async fn try_capture_json(
self,
selectors: impl IntoIterator<Item = JsonPath> + Send,
max_capture_bytes: usize,
) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Send + Sync>>
async fn try_capture_json( self, selectors: impl IntoIterator<Item = JsonPath> + Send, max_capture_bytes: usize, ) -> Result<Vec<OwnedCapturedValue>, Box<dyn Error + Send + Sync>>
selectors while streaming over the body. Read more§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,
§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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more