pub struct File { /* private fields */ }Expand description
A mapped file containing extents and an optional transformation (compression or encryption).
Implementations§
Source§impl File
impl File
pub fn new( extents: Extents, uncompressed_size: u64, transform: Transform, ) -> 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 file in bytes.
Sourcepub fn transform(&self) -> &Transform
pub fn transform(&self) -> &Transform
Returns the transform applied to the file if compressed or encrypted.
Sourcepub fn compression_info(&self) -> Option<&CompressionInfo>
pub fn compression_info(&self) -> Option<&CompressionInfo>
Returns decompression metadata if the file is compressed.
Sourcepub fn read_range(
self: &Arc<Self>,
service: &(impl BlockService + ?Sized),
page_request: impl PageRequest,
)
pub fn read_range( self: &Arc<Self>, service: &(impl BlockService + ?Sized), page_request: impl PageRequest, )
Streams and decodes the uncompressed range requested by page_request, applying readahead.
Auto Trait Implementations§
impl !RefUnwindSafe for File
impl !UnwindSafe for File
impl Freeze for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
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