pub struct ReadObjectResponse<C> { /* private fields */ }Expand description
A response to a Storage::read_object request.
Implementations§
Source§impl<C> ReadObjectResponse<C>
impl<C> ReadObjectResponse<C>
Sourcepub fn object(&self) -> ObjectHighlights
pub fn object(&self) -> ObjectHighlights
Get the highlights of the object metadata included in the response.
To get full metadata about this object, use crate::client::StorageControl::get_object.
§Example
let object = client
.read_object("projects/_/buckets/my-bucket", "my-object")
.send()
.await?
.object();
println!("object generation={}", object.generation);
println!("object metageneration={}", object.metageneration);
println!("object size={}", object.size);
println!("object content encoding={}", object.content_encoding);Sourcepub async fn next(&mut self) -> Option<Result<Bytes>>
pub async fn next(&mut self) -> Option<Result<Bytes>>
Stream the next bytes of the object.
When the response has been exhausted, this will return None.
§Example
let mut resp = client
.read_object("projects/_/buckets/my-bucket", "my-object")
.send()
.await?;
while let Some(next) = resp.next().await {
println!("next={:?}", next?);
}Trait Implementations§
Auto Trait Implementations§
impl<C> !Freeze for ReadObjectResponse<C>
impl<C> !RefUnwindSafe for ReadObjectResponse<C>
impl<C> Send for ReadObjectResponse<C>where
C: Send,
impl<C> Sync for ReadObjectResponse<C>where
C: Sync,
impl<C> Unpin for ReadObjectResponse<C>where
C: Unpin,
impl<C> !UnwindSafe for ReadObjectResponse<C>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request