Struct glommio::io::DmaStreamWriterBuilder
source · [−]pub struct DmaStreamWriterBuilder { /* private fields */ }
Expand description
Builds a DmaStreamWriter, allowing linear access to a Direct I/O DmaFile
Implementations
sourceimpl DmaStreamWriterBuilder
impl DmaStreamWriterBuilder
sourcepub fn new(file: DmaFile) -> DmaStreamWriterBuilder
pub fn new(file: DmaFile) -> DmaStreamWriterBuilder
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();
});
sourcepub fn with_write_behind(self, write_behind: usize) -> Self
pub fn with_write_behind(self, write_behind: usize) -> Self
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.
sourcepub fn with_sync_on_close_disabled(self, flush_disabled: bool) -> Self
pub fn with_sync_on_close_disabled(self, flush_disabled: bool) -> Self
Does not issue a sync operation when closing the file. This is dangerous and in most cases may lead to data loss.
sourcepub fn with_buffer_size(self, buffer_size: usize) -> Self
pub fn with_buffer_size(self, buffer_size: usize) -> Self
Define the buffer size that will be used by the DmaStreamWriter
sourcepub fn build(self) -> DmaStreamWriter
pub fn build(self) -> DmaStreamWriter
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more