pub struct FileWriter { /* private fields */ }
Implementations§
Source§impl FileWriter
impl FileWriter
Sourcepub fn create(path: impl AsRef<Path>, mode: MemoryFileMode) -> Self
pub fn create(path: impl AsRef<Path>, mode: MemoryFileMode) -> Self
Creates a new file with the specified mode
Sourcepub fn write_at_start(&mut self, data: &[u8]) -> Result<(), ()>
pub fn write_at_start(&mut self, data: &[u8]) -> Result<(), ()>
Overwrites bytes at the start of the file, the data field should not be longer than 128 bytes
Sourcepub fn write_all_parallel(&self, data: &[u8], el_size: usize) -> u64
pub fn write_all_parallel(&self, data: &[u8], el_size: usize) -> u64
Appends atomically all the data to the file, returning the start position of the written data in the file
pub fn get_path(&self) -> PathBuf
pub fn flush_async(&self)
Trait Implementations§
Source§impl Drop for FileWriter
impl Drop for FileWriter
Source§impl Write for FileWriter
impl Write for FileWriter
Source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
Writes a buffer into this writer, returning how many bytes were written. Read more
Source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flushes this output stream, ensuring that all intermediately buffered
contents reach their destination. Read more
Source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
🔬This is a nightly-only experimental API. (
can_vector
)1.0.0 · Source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
Attempts to write an entire buffer into this writer. Read more
Source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
🔬This is a nightly-only experimental API. (
write_all_vectored
)Attempts to write multiple buffers into this writer. Read more
Auto Trait Implementations§
impl !Freeze for FileWriter
impl !RefUnwindSafe for FileWriter
impl Send for FileWriter
impl Sync for FileWriter
impl Unpin for FileWriter
impl !UnwindSafe for FileWriter
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> 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