pub struct TieredReadableFile(pub File);
Tuple Fields§
§0: File
Implementations§
Source§impl TieredReadableFile
impl TieredReadableFile
pub fn new(file_path: impl AsRef<Path>) -> TieredStorageResult<Self>
pub fn new_writable(file_path: impl AsRef<Path>) -> IoResult<Self>
Sourcepub fn read_pod<T: NoUninit + AnyBitPattern>(
&self,
value: &mut T,
) -> IoResult<()>
pub fn read_pod<T: NoUninit + AnyBitPattern>( &self, value: &mut T, ) -> IoResult<()>
Reads a value of type T
from the file.
Type T must be plain ol’ data.
Sourcepub unsafe fn read_type<T>(&self, value: &mut T) -> IoResult<()>
pub unsafe fn read_type<T>(&self, value: &mut T) -> IoResult<()>
Reads a value of type T
from the file.
Prefer read_pod()
when possible, because read_type()
may cause
undefined behavior.
§Safety
Caller must ensure casting bytes to T is safe. Refer to the Safety sections in std::slice::from_raw_parts() and bytemuck’s Pod and AnyBitPattern for more information.
pub fn seek(&self, offset: u64) -> IoResult<u64>
pub fn seek_from_end(&self, offset: i64) -> IoResult<u64>
pub fn read_bytes(&self, buffer: &mut [u8]) -> IoResult<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TieredReadableFile
impl RefUnwindSafe for TieredReadableFile
impl Send for TieredReadableFile
impl Sync for TieredReadableFile
impl Unpin for TieredReadableFile
impl UnwindSafe for TieredReadableFile
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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