pub struct InsertPayload<T> { /* private fields */ }Expand description
The payload for object uploads via the Storage client.
The storage client functions to upload new objects consume any type that can be converted to this type. That includes simple buffers, and any type implementing StreamingSource.
§Example
use google_cloud_storage::upload_source::StreamingSource;
let buffer : &[u8] = b"the quick brown fox jumps over the lazy dog";
let mut size = 0_usize;
let mut payload = InsertPayload::from(buffer);
while let Some(bytes) = payload.next().await.transpose()? {
size += bytes.len();
}
assert_eq!(size, buffer.len());Trait Implementations§
Source§impl From<&'static [u8]> for InsertPayload<BytesSource>
impl From<&'static [u8]> for InsertPayload<BytesSource>
Source§impl From<&'static str> for InsertPayload<BytesSource>
impl From<&'static str> for InsertPayload<BytesSource>
Source§impl From<Bytes> for InsertPayload<BytesSource>
impl From<Bytes> for InsertPayload<BytesSource>
Source§impl<S> From<S> for InsertPayload<S>where
S: StreamingSource + Seek,
impl<S> From<S> for InsertPayload<S>where
S: StreamingSource + Seek,
Source§impl<T> Seek for InsertPayload<T>where
T: Seek,
impl<T> Seek for InsertPayload<T>where
T: Seek,
Source§impl<T> StreamingSource for InsertPayload<T>where
T: StreamingSource,
impl<T> StreamingSource for InsertPayload<T>where
T: StreamingSource,
Auto Trait Implementations§
impl<T> Freeze for InsertPayload<T>where
T: Freeze,
impl<T> RefUnwindSafe for InsertPayload<T>where
T: RefUnwindSafe,
impl<T> Send for InsertPayload<T>where
T: Send,
impl<T> Sync for InsertPayload<T>where
T: Sync,
impl<T> Unpin for InsertPayload<T>where
T: Unpin,
impl<T> UnwindSafe for InsertPayload<T>where
T: UnwindSafe,
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