pub struct Blob { /* private fields */ }Expand description
A mapped blob containing extents and decompression metadata.
Implementations§
Source§impl Blob
impl Blob
pub fn new( extents: Extents, uncompressed_size: u64, compression_info: Option<CompressionInfo>, ) -> Self
Sourcepub fn extents(&self) -> &Extents
pub fn extents(&self) -> &Extents
Returns the extents mapping logical offsets to device offsets.
Sourcepub fn uncompressed_size(&self) -> u64
pub fn uncompressed_size(&self) -> u64
Returns the uncompressed size of the blob in bytes.
Sourcepub fn compression_info(&self) -> Option<&CompressionInfo>
pub fn compression_info(&self) -> Option<&CompressionInfo>
Returns decompression metadata if the blob is compressed.
Sourcepub fn read_range(
&self,
range: Range<u64>,
service: &(impl BlockService + ?Sized),
dest_buf: impl DataBuffer,
)
pub fn read_range( &self, range: Range<u64>, service: &(impl BlockService + ?Sized), dest_buf: impl DataBuffer, )
Streams and decodes the specified uncompressed range into the provided dest_buf.
For uncompressed blobs, both range.start and range.end must be multiples of
BLOCK_SIZE. For compressed blobs, range.start must be a multiple of the compression
chunk size, and range.end must either be a multiple of the chunk size or equal to
uncompressed_size.
Auto Trait Implementations§
impl Freeze for Blob
impl RefUnwindSafe for Blob
impl Send for Blob
impl Sync for Blob
impl Unpin for Blob
impl UnsafeUnpin for Blob
impl UnwindSafe for Blob
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more