Struct parallel_processor::memory_fs::file::writer::FileWriter
source · 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, buf: &[u8], el_size: usize) -> u64
pub fn write_all_parallel(&self, buf: &[u8], el_size: usize) -> u64
Appends atomically all the buffer to the file, returning the start position of the buffer 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>
Write a buffer into this writer, returning how many bytes were written. Read more
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
Flush 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