pub struct NativeRtBuilder { /* private fields */ }Available on crate feature
native only.Expand description
Builder for the NativeRt.
This builder allows configuring the I/O backends to try to construct for the filesystem handle. Note that the order of backends is fixed, and is as follows:
- io_uring
- mio
- thread
The full order (including unsupported/disabled backends) is as follows:
io_uringiocpmiothread
If you wish to customize the construction order, please use multiple builders.
Implementations§
Source§impl NativeRtBuilder
impl NativeRtBuilder
Sourcepub fn all_backends() -> Self
pub fn all_backends() -> Self
Get a NativeRtBuilder with all backends enabled.
Sourcepub fn env_backends() -> Self
pub fn env_backends() -> Self
Get a NativeRtBuilder with backends specified by environment.
This function attempts to parse MFIO_FS_BACKENDS environment variable and load
backends specified by it. If the environment variable is not present, or
non-unicode, this function falls back to using
all_backends.
pub fn enable_all(self) -> Self
Sourcepub fn io_uring(self, io_uring: bool) -> Self
Available on non-miri and Linux and crate feature io-uring only.
pub fn io_uring(self, io_uring: bool) -> Self
miri and Linux and crate feature io-uring only.Enables the io_uring backend.
Sourcepub fn mio(self, mio: bool) -> Self
Available on non-miri and Unix and crate feature mio only.
pub fn mio(self, mio: bool) -> Self
miri and Unix and crate feature mio only.Enables the mio backend.
pub fn build(self) -> Result<NativeRt>
pub fn build_each(self) -> Vec<(&'static str, Result<NativeRt>)>
Trait Implementations§
Source§impl Default for NativeRtBuilder
impl Default for NativeRtBuilder
Source§fn default() -> NativeRtBuilder
fn default() -> NativeRtBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NativeRtBuilder
impl RefUnwindSafe for NativeRtBuilder
impl Send for NativeRtBuilder
impl Sync for NativeRtBuilder
impl Unpin for NativeRtBuilder
impl UnwindSafe for NativeRtBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more