pub struct TieredWritableFile(pub BufWriter<File>);
Tuple Fields§
§0: BufWriter<File>
Implementations§
Source§impl TieredWritableFile
impl TieredWritableFile
pub fn new(file_path: impl AsRef<Path>) -> IoResult<Self>
Sourcepub fn write_pod<T: NoUninit>(&mut self, value: &T) -> IoResult<usize>
pub fn write_pod<T: NoUninit>(&mut self, value: &T) -> IoResult<usize>
Writes value
to the file.
value
must be plain ol’ data.
Sourcepub unsafe fn write_type<T>(&mut self, value: &T) -> IoResult<usize>
pub unsafe fn write_type<T>(&mut self, value: &T) -> IoResult<usize>
Writes value
to the file.
Prefer write_pod
when possible, because write_value
may cause
undefined behavior if value
contains uninitialized bytes.
§Safety
Caller must ensure casting T to bytes is safe. Refer to the Safety sections in std::slice::from_raw_parts() and bytemuck’s Pod and NoUninit for more information.
pub fn seek(&mut self, offset: u64) -> IoResult<u64>
pub fn seek_from_end(&mut self, offset: i64) -> IoResult<u64>
pub fn write_bytes(&mut self, bytes: &[u8]) -> IoResult<usize>
Trait Implementations§
Source§impl Debug for TieredWritableFile
impl Debug for TieredWritableFile
Auto Trait Implementations§
impl Freeze for TieredWritableFile
impl RefUnwindSafe for TieredWritableFile
impl Send for TieredWritableFile
impl Sync for TieredWritableFile
impl Unpin for TieredWritableFile
impl UnwindSafe for TieredWritableFile
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