Struct BoltOptionsBuilder

Source
pub struct BoltOptionsBuilder<TypedBuilderFields = ((), (), (), (), (), (), ())> { /* private fields */ }
Expand description

Builder for BoltOptions instances.

See BoltOptions::builder() for more info.

Implementations§

Source§

impl<__initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay> BoltOptionsBuilder<((), __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

Source

pub fn preload_freelist( self, ) -> BoltOptionsBuilder<((bool,), __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

Sets whether to load the free pages when opening the db file.Note when opening db in write mode, bbolt will always load the free pages.

Source§

impl<__preload_freelist, __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay> BoltOptionsBuilder<(__preload_freelist, (), __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

Source

pub fn initial_mmap_size( self, initial_mmap_size: u64, ) -> BoltOptionsBuilder<(__preload_freelist, (Option<u64>,), __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

InitialMmapSize is the initial mmap size of the database in bytes. Read transactions won’t block write transaction if the InitialMmapSize is large enough to hold database mmap size.

Source§

impl<__preload_freelist, __initial_mmap_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, (), __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

Source

pub fn page_size( self, page_size: usize, ) -> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, (Option<usize>,), __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

PageSize overrides the default OS page size.

Source§

impl<__preload_freelist, __initial_mmap_size, __page_size, __mlock, __max_batch_size, __max_batch_delay> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, (), __mlock, __max_batch_size, __max_batch_delay)>

Source

pub fn no_sync( self, ) -> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, (bool,), __mlock, __max_batch_size, __max_batch_delay)>

NoSync sets the initial value of DB.NoSync. Normally this can just be set directly on the DB itself when returned from Open(), but this option is useful in APIs which expose Options but not the underlying DB.

Source§

impl<__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __max_batch_size, __max_batch_delay> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, (), __max_batch_size, __max_batch_delay)>

Source

pub fn mlock( self, ) -> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, (bool,), __max_batch_size, __max_batch_delay)>

Mlock locks database file in memory when set to true. It prevents potential page faults, however used memory can’t be reclaimed. (UNIX only)

Source§

impl<__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_delay> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, (), __max_batch_delay)>

Source

pub fn max_batch_size( self, max_batch_size: u32, ) -> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, (Option<u32>,), __max_batch_delay)>

max_batch_size is the maximum size of a batch.

Source§

impl<__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, ())>

Source

pub fn max_batch_delay( self, max_batch_delay: Duration, ) -> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, (Option<Duration>,))>

max_batch_delay is the maximum delay before a batch starts.

Source§

impl<__preload_freelist: Optional<bool>, __initial_mmap_size: Optional<Option<u64>>, __page_size: Optional<Option<usize>>, __no_sync: Optional<bool>, __mlock: Optional<bool>, __max_batch_size: Optional<Option<u32>>, __max_batch_delay: Optional<Option<Duration>>> BoltOptionsBuilder<(__preload_freelist, __initial_mmap_size, __page_size, __no_sync, __mlock, __max_batch_size, __max_batch_delay)>

Source

pub fn build(self) -> BoltOptions

Finalise the builder and create its BoltOptions instance

Trait Implementations§

Source§

impl<TypedBuilderFields> Clone for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: Clone,

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<TypedBuilderFields> Freeze for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: Freeze,

§

impl<TypedBuilderFields> RefUnwindSafe for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: RefUnwindSafe,

§

impl<TypedBuilderFields> Send for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: Send,

§

impl<TypedBuilderFields> Sync for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: Sync,

§

impl<TypedBuilderFields> Unpin for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: Unpin,

§

impl<TypedBuilderFields> UnwindSafe for BoltOptionsBuilder<TypedBuilderFields>
where TypedBuilderFields: UnwindSafe,

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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.