Struct object_store::GetResult
source · pub struct GetResult {
pub payload: GetResultPayload,
pub meta: ObjectMeta,
pub range: Range<usize>,
pub attributes: Attributes,
}
Expand description
Result for a get request
Fields§
§payload: GetResultPayload
The GetResultPayload
meta: ObjectMeta
The ObjectMeta
for this object
range: Range<usize>
The range of bytes returned by this request
attributes: Attributes
Additional object attributes
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 Freeze for GetResult
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
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>
Converts
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>
Converts
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