pub struct ContentUploadChunk { /* private fields */ }Expand description
One immutable local byte chunk submitted to a backend upload session.
Implementations§
Source§impl ContentUploadChunk
impl ContentUploadChunk
Sourcepub fn new(
session_id: ContentUploadSessionId,
local_generation: LocalContentGeneration,
offset: u64,
bytes: Bytes,
total_size: u64,
) -> Result<Self>
pub fn new( session_id: ContentUploadSessionId, local_generation: LocalContentGeneration, offset: u64, bytes: Bytes, total_size: u64, ) -> Result<Self>
Creates a non-empty chunk within the immutable snapshot size.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn session_id(&self) -> &ContentUploadSessionId
pub const fn session_id(&self) -> &ContentUploadSessionId
Returns the backend upload-session identity.
Sourcepub const fn local_generation(&self) -> LocalContentGeneration
pub const fn local_generation(&self) -> LocalContentGeneration
Returns the immutable local generation whose bytes are carried.
Sourcepub const fn end_exclusive(&self) -> u64
pub const fn end_exclusive(&self) -> u64
Returns the exclusive end acknowledged when this chunk commits exactly.
Sourcepub const fn total_size(&self) -> u64
pub const fn total_size(&self) -> u64
Returns the complete immutable snapshot size.
Sourcepub fn validate_for(
&self,
intent: &ContentUploadIntent,
session: &ContentUploadSession,
) -> Result<()>
pub fn validate_for( &self, intent: &ContentUploadIntent, session: &ContentUploadSession, ) -> Result<()>
Validates that this chunk continues the exact durable session and immutable snapshot.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Trait Implementations§
Source§impl Clone for ContentUploadChunk
impl Clone for ContentUploadChunk
Source§fn clone(&self) -> ContentUploadChunk
fn clone(&self) -> ContentUploadChunk
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentUploadChunk
impl Debug for ContentUploadChunk
Source§impl PartialEq for ContentUploadChunk
impl PartialEq for ContentUploadChunk
impl Eq for ContentUploadChunk
impl StructuralPartialEq for ContentUploadChunk
Auto Trait Implementations§
impl !Freeze for ContentUploadChunk
impl RefUnwindSafe for ContentUploadChunk
impl Send for ContentUploadChunk
impl Sync for ContentUploadChunk
impl Unpin for ContentUploadChunk
impl UnwindSafe for ContentUploadChunk
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