Struct condow_core::Request
source · [−]pub struct Request<L> { /* private fields */ }Expand description
A request for a download from a specific location
The default is to download the complete BLOB.
Implementations
sourceimpl<L> Request<L>
impl<L> Request<L>
sourcepub fn at<LL: Into<L>>(self, location: LL) -> Self
pub fn at<LL: Into<L>>(self, location: LL) -> Self
Specify the location to download the Blob from
sourcepub fn range<DR: Into<DownloadRange>>(self, range: DR) -> Self
pub fn range<DR: Into<DownloadRange>>(self, range: DR) -> Self
Specify the range to download
sourcepub fn get_size_mode(self, get_size_mode: GetSizeMode) -> Self
pub fn get_size_mode(self, get_size_mode: GetSizeMode) -> Self
Explicitly set the condition on when to query for the Blob size
sourcepub async fn download(self) -> Result<OrderedChunkStream, CondowError>
pub async fn download(self) -> Result<OrderedChunkStream, CondowError>
Download as an OrderedChunkStream
sourcepub async fn download_chunks(self) -> Result<ChunkStream, CondowError>
pub async fn download_chunks(self) -> Result<ChunkStream, CondowError>
Download as a ChunkStream
sourcepub async fn download_into_vec(self) -> Result<Vec<u8>, CondowError>
pub async fn download_into_vec(self) -> Result<Vec<u8>, CondowError>
Downloads into a freshly allocated Vec
sourcepub async fn download_into_buffer(
self,
buffer: &mut [u8]
) -> Result<usize, CondowError>
pub async fn download_into_buffer(
self,
buffer: &mut [u8]
) -> Result<usize, CondowError>
Writes all received bytes into the provided buffer
Fails if the buffer is too small.
sourcepub async fn reader(self) -> Result<impl AsyncRead, CondowError>
pub async fn reader(self) -> Result<impl AsyncRead, CondowError>
Returns an [AsyncRead] which reads over the bytes of the stream
sourcepub async fn wc(self) -> Result<(), CondowError>
pub async fn wc(self) -> Result<(), CondowError>
Pulls the bytes into the void
Auto Trait Implementations
impl<L> !RefUnwindSafe for Request<L>
impl<L> Send for Request<L> where
L: Send,
impl<L> !Sync for Request<L>
impl<L> Unpin for Request<L> where
L: Unpin,
impl<L> !UnwindSafe for Request<L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more