pub struct UploadChunkCtx<'a> {
pub client: &'a Client,
pub task: &'a TransferTask,
pub chunk: Bytes,
pub offset: u64,
}Expand description
Context for upload chunk stage.
UploadChunkCtx::chunk is a bytes::Bytes handle. Cloning it is an
O(1) refcount bump, and passing it into reqwest::Body never copies the
underlying buffer. This lets protocol implementations send the same chunk
multiple times (for example during retries) without re-allocating.
Fields§
§client: &'a ClientHTTP client used for requests.
task: &'a TransferTaskImmutable task snapshot.
chunk: BytesRaw bytes for the current chunk.
Bytes is cheap to clone and can be converted into reqwest::Body
without copying. Avoid calling [bytes::Bytes::to_vec] on hot paths.
offset: u64Start offset of this chunk in the full file.
Range: >= 0.
Trait Implementations§
Source§impl<'a> Clone for UploadChunkCtx<'a>
impl<'a> Clone for UploadChunkCtx<'a>
Source§fn clone(&self) -> UploadChunkCtx<'a>
fn clone(&self) -> UploadChunkCtx<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<'a> !Freeze for UploadChunkCtx<'a>
impl<'a> !RefUnwindSafe for UploadChunkCtx<'a>
impl<'a> Send for UploadChunkCtx<'a>
impl<'a> Sync for UploadChunkCtx<'a>
impl<'a> Unpin for UploadChunkCtx<'a>
impl<'a> UnsafeUnpin for UploadChunkCtx<'a>
impl<'a> !UnwindSafe for UploadChunkCtx<'a>
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