Struct glommio::io::DmaStreamWriterBuilder [−][src]
pub struct DmaStreamWriterBuilder { /* fields omitted */ }
Expand description
Builds a DmaStreamWriter, allowing linear access to a Direct I/O DmaFile
Implementations
Creates a new DmaStreamWriterBuilder, given a DmaFile
Various properties can be set by using its with
methods.
A DmaStreamWriter
can later be constructed from it by
calling build
Examples
use glommio::{ io::{DmaFile, DmaStreamWriterBuilder}, LocalExecutor, }; let ex = LocalExecutor::default(); ex.run(async { let file = DmaFile::create("myfile.txt").await.unwrap(); let _reader = DmaStreamWriterBuilder::new(file).build(); });
Define the number of write-behind buffers that will be used by the
DmaStreamWriter
Higher write-behind numbers mean more parallelism but also more memory
usage. As long as there is still write-behind buffers available
writing to this DmaStreamWriter
will not block.
Does not issue a sync operation when closing the file. This is dangerous and in most cases may lead to data loss.
Define the buffer size that will be used by the DmaStreamWriter
Builds a DmaStreamWriter
with the properties defined by this
DmaStreamWriterBuilder