Skip to main content

SequentialFileReaderBuilder

Struct SequentialFileReaderBuilder 

Source
pub struct SequentialFileReaderBuilder<'sp> { /* private fields */ }
Expand description

Utility for building SequentialFileReader with specified tuning options.

Implementations§

Source§

impl<'sp> SequentialFileReaderBuilder<'sp>

Source

pub fn new() -> Self

Source

pub fn use_registered_buffers(self, register_buffers: bool) -> Self

Set whether to register buffer with io_uring for improved performance.

Enabling requires available memlock ulimit to be higher than sizes of registered buffers.

Source

pub fn use_direct_io(self, use_direct_io: bool) -> Self

Read files in direct-IO mode (disables kernel caching of read contents).

Enabling requires the filesystem to support directio and read_capacity to be a multiple of 4096.

Source

pub fn shared_sqpoll(self, shared_sqpoll_fd: Option<BorrowedFd<'sp>>) -> Self

Use (or remove) a shared kernel thread to drain submission queue for IO operations

Source

pub fn build<'a>(self, buf_capacity: usize) -> Result<SequentialFileReader<'a>>

Build a new SequentialFileReader with internally allocated buffer.

Buffer will hold at least buf_capacity bytes (increased to read_capacity if it’s lower).

Initially the reader is idle and starts reading after set_file is called. It will then execute multiple read_capacity sized reads in parallel to fill the buffer.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.