Struct object_store::GetResult
source · pub struct GetResult {
pub payload: GetResultPayload,
pub meta: ObjectMeta,
pub range: Range<usize>,
}Expand description
Result for a get request
Fields§
§payload: GetResultPayloadThe GetResultPayload
meta: ObjectMetaThe ObjectMeta for this object
range: Range<usize>The range of bytes returned by this request
Implementations§
source§impl GetResult
impl GetResult
sourcepub fn into_stream(self) -> BoxStream<'static, Result<Bytes>>
pub fn into_stream(self) -> BoxStream<'static, Result<Bytes>>
Converts this into a byte stream
If the self.kind is GetResultPayload::File will perform chunked reads of the file,
otherwise will return the GetResultPayload::Stream.
§Tokio Compatibility
Tokio discourages performing blocking IO on a tokio worker thread, however,
no major operating systems have stable async file APIs. Therefore if called from
a tokio context, this will use tokio::runtime::Handle::spawn_blocking to dispatch
IO to a blocking thread pool, much like tokio::fs does under-the-hood.
If not called from a tokio context, this will perform IO on the current thread with no additional complexity or overheads
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for GetResult
impl Send for GetResult
impl !Sync for GetResult
impl Unpin for GetResult
impl !UnwindSafe for GetResult
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