pub struct Data { /* private fields */ }Expand description
A buffer of bytes, which may be inline or on the host.
Some bulk data processing Functions may choose to pass data straight from a
request or response body to another request or response body. To improve
performance on these kinds of Functions, Data avoids copying the buffer
into your function’s memory.
Implementations§
Source§impl Data
impl Data
Sourcepub fn into_bytes(self) -> Vec<u8> ⓘ
pub fn into_bytes(self) -> Vec<u8> ⓘ
Turn the Data into a plain Vec<u8>.
If the data is buffered on the host, this will read the buffer completely into your function’s memory. You should use this with caution!
For small buffers, this is inconsequential. For larger buffers, this may cause your function to run out of memory or to run slowly.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Data
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnsafeUnpin for Data
impl UnwindSafe for Data
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