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: GetResultPayloadThe GetResultPayload
meta: ObjectMetaThe ObjectMeta for this object
range: Range<usize>The range of bytes returned by this request
attributes: AttributesAdditional 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