pub struct ContentReadResponse { /* private fields */ }Expand description
Owned content bytes returned for one exact revision and logical offset.
Implementations§
Source§impl ContentReadResponse
impl ContentReadResponse
Sourcepub fn new(
revision: ContentRevision,
offset: u64,
bytes: Bytes,
total_size: u64,
) -> Result<Self>
pub fn new( revision: ContentRevision, offset: u64, bytes: Bytes, total_size: u64, ) -> Result<Self>
Creates a response and verifies that its bytes remain within the logical file size.
§Errors
Returns an error when validation fails or an underlying backend, store, or platform operation fails.
Sourcepub const fn revision(&self) -> &ContentRevision
pub const fn revision(&self) -> &ContentRevision
Returns the exact content revision represented by these bytes.
Sourcepub const fn total_size(&self) -> u64
pub const fn total_size(&self) -> u64
Returns the complete logical file size for this revision.
Sourcepub fn is_complete_file(&self) -> bool
pub fn is_complete_file(&self) -> bool
Returns whether the response contains the complete file, including an empty file.
Sourcepub fn into_parts(self) -> (ContentRevision, u64, Bytes, u64)
pub fn into_parts(self) -> (ContentRevision, u64, Bytes, u64)
Consumes the response and returns its revision, offset, bytes, and total size.
Trait Implementations§
Source§impl Clone for ContentReadResponse
impl Clone for ContentReadResponse
Source§fn clone(&self) -> ContentReadResponse
fn clone(&self) -> ContentReadResponse
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 ContentReadResponse
impl Debug for ContentReadResponse
Source§impl PartialEq for ContentReadResponse
impl PartialEq for ContentReadResponse
impl Eq for ContentReadResponse
impl StructuralPartialEq for ContentReadResponse
Auto Trait Implementations§
impl !Freeze for ContentReadResponse
impl RefUnwindSafe for ContentReadResponse
impl Send for ContentReadResponse
impl Sync for ContentReadResponse
impl Unpin for ContentReadResponse
impl UnwindSafe for ContentReadResponse
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