[][src]Struct glommio::io::DmaStreamReaderBuilder

pub struct DmaStreamReaderBuilder { /* fields omitted */ }

Builds a DmaStreamReader, allowing linear access to a Direct I/O DmaFile

Implementations

impl DmaStreamReaderBuilder[src]

#[must_use = "The builder must be built to be useful"]pub fn new(file: DmaFile) -> DmaStreamReaderBuilder[src]

Creates a new DmaStreamReaderBuilder, given a DmaFile

Various properties can be set by using its with methods.

A DmaStreamReader can later be constructed from it by calling build

Examples

use glommio::io::{DmaFile, DmaStreamReaderBuilder};
use glommio::LocalExecutor;

let ex = LocalExecutor::make_default();
ex.run(async {
    let file = DmaFile::open("myfile.txt").await.unwrap();
    let _reader = DmaStreamReaderBuilder::new(file).build();
});

pub fn with_start_pos(self, start: u64) -> Self[src]

Define a starting position.

Reads from the DmaStreamReader will start from this position

pub fn with_end_pos(self, end: u64) -> Self[src]

Define an end position.

Reads from the DmaStreamReader will end at this position even if the file is larger.

pub fn with_read_ahead(self, read_ahead: usize) -> Self[src]

Define the number of read-ahead buffers that will be used by the DmaStreamReader

Higher read-ahead numbers mean more parallelism but also more memory usage.

pub fn with_buffer_size(self, buffer_size: usize) -> Self[src]

Define the buffer size that will be used by the DmaStreamReader

pub fn build(self) -> DmaStreamReader[src]

Builds a DmaStreamReader with the properties defined by this DmaStreamReaderBuilder

Trait Implementations

impl Clone for DmaStreamReaderBuilder[src]

impl Debug for DmaStreamReaderBuilder[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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.