Struct glommio::io::DmaStreamWriterBuilder[][src]

pub struct DmaStreamWriterBuilder { /* fields omitted */ }

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

impl Debug for DmaStreamWriterBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

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]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.