pub struct HttpRangeReader { /* private fields */ }Expand description
An HTTP(S) RangeReader: kept-alive connections, parallel and coalesced
batches, retries, and the bounded whole-body fallback for hosts that ignore
Range (see the module docs).
Implementations§
Source§impl HttpRangeReader
impl HttpRangeReader
Sourcepub fn open(url: &str) -> Result<Self>
pub fn open(url: &str) -> Result<Self>
Open url under FetchPolicy::from_env, with no extra headers.
Sourcepub fn open_with(url: &str, policy: FetchPolicy) -> Result<Self>
pub fn open_with(url: &str, policy: FetchPolicy) -> Result<Self>
open under an explicit fetch policy.
Sourcepub fn open_with_headers(
url: &str,
headers: Vec<(String, String)>,
policy: FetchPolicy,
) -> Result<Self>
pub fn open_with_headers( url: &str, headers: Vec<(String, String)>, policy: FetchPolicy, ) -> Result<Self>
Open url, sending headers with every request. The length comes from
a HEAD’s Content-Length; a host that omits it, or refuses HEAD
(a presigned GET-only URL), is asked with a bytes=0-0 GET instead,
whose Content-Range carries the total — and a 200 to that GET is the
whole file, kept under the whole-body rules.
Sourcepub fn serves_whole_body(&self) -> bool
pub fn serves_whole_body(&self) -> bool
Whether the host ignored Range and every read is now served from the
whole body held in memory.
Trait Implementations§
Source§impl RangeReader for HttpRangeReader
impl RangeReader for HttpRangeReader
Source§fn concurrency(&self) -> usize
fn concurrency(&self) -> usize
The planner’s probe-vs-scan hint: how many requests
read_many keeps in flight.
Source§fn read_many(&self, ranges: &[(u64, u64)]) -> Result<Vec<Vec<u8>>>
fn read_many(&self, ranges: &[(u64, u64)]) -> Result<Vec<Vec<u8>>>
Coalesce the batch, fetch its requests concurrently, slice the ranges back out in request order.
Auto Trait Implementations§
impl !Freeze for HttpRangeReader
impl !RefUnwindSafe for HttpRangeReader
impl !UnwindSafe for HttpRangeReader
impl Send for HttpRangeReader
impl Sync for HttpRangeReader
impl Unpin for HttpRangeReader
impl UnsafeUnpin for HttpRangeReader
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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