Struct glommio::io::DmaStreamWriterBuilder [−][src]
Builds a DmaStreamWriter, allowing linear access to a Direct I/O DmaFile
Implementations
impl DmaStreamWriterBuilder
[src]
#[must_use = "The builder must be built to be useful"]pub fn new(file: DmaFile) -> DmaStreamWriterBuilder
[src]
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}; use glommio::LocalExecutor; let ex = LocalExecutor::default(); ex.run(async { let file = DmaFile::create("myfile.txt").await.unwrap(); let _reader = DmaStreamWriterBuilder::new(file).build(); });
pub fn with_write_behind(self, write_behind: usize) -> Self
[src]
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.
pub fn with_sync_on_close_disabled(self, flush_disabled: bool) -> Self
[src]
Does not issue a sync operation when closing the file. This is dangerous and in most cases may lead to data loss.
pub fn with_buffer_size(self, buffer_size: usize) -> Self
[src]
Define the buffer size that will be used by the DmaStreamWriter
pub fn build(self) -> DmaStreamWriter
[src]
Builds a DmaStreamWriter
with the properties defined by this DmaStreamWriterBuilder
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for DmaStreamWriterBuilder
impl !Send for DmaStreamWriterBuilder
impl !Sync for DmaStreamWriterBuilder
impl Unpin for DmaStreamWriterBuilder
impl !UnwindSafe for DmaStreamWriterBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,