Struct bbolt_rs::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)>

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)>

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)>

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 copy 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> 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,

§

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>,

§

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>,

§

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.