Struct foyer::DirectFsDeviceOptionsBuilder
source · pub struct DirectFsDeviceOptionsBuilder { /* private fields */ }Expand description
DirectFsDeviceOptionsBuilder is used to build the options for the direct fs device.
The direct fs device uses a directory in a file system to store the data of disk cache.
It uses direct I/O to reduce buffer copy and page cache pollution if supported.
Implementations§
source§impl DirectFsDeviceOptionsBuilder
impl DirectFsDeviceOptionsBuilder
sourcepub fn new(dir: impl AsRef<Path>) -> DirectFsDeviceOptionsBuilder
pub fn new(dir: impl AsRef<Path>) -> DirectFsDeviceOptionsBuilder
Use the given dir as the direct fs device.
sourcepub fn with_capacity(self, capacity: usize) -> DirectFsDeviceOptionsBuilder
pub fn with_capacity(self, capacity: usize) -> DirectFsDeviceOptionsBuilder
Set the capacity of the direct fs device.
The given capacity may be modified on build for alignment.
The direct fs device uses 80% of the current free disk space by default.
sourcepub fn with_file_size(self, file_size: usize) -> DirectFsDeviceOptionsBuilder
pub fn with_file_size(self, file_size: usize) -> DirectFsDeviceOptionsBuilder
Set the file size of the direct fs device.
The given file size may be modified on build for alignment.
The serialized entry size (with extra metadata) must be equal to or smaller than the file size.
sourcepub fn build(self) -> DirectFsDeviceOptions
pub fn build(self) -> DirectFsDeviceOptions
Build the options of the direct fs device with the given arguments.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DirectFsDeviceOptionsBuilder
impl RefUnwindSafe for DirectFsDeviceOptionsBuilder
impl Send for DirectFsDeviceOptionsBuilder
impl Sync for DirectFsDeviceOptionsBuilder
impl Unpin for DirectFsDeviceOptionsBuilder
impl UnwindSafe for DirectFsDeviceOptionsBuilder
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more