[][src]Struct pearl::Builder

pub struct Builder { /* fields omitted */ }

Is used to initialize a Storage.

Required params:

Example

use pearl::{Builder, Storage, Key};

struct Id;

let storage: Storage<Id> = Builder::new()
        .blob_file_name_prefix("benchmark")
        .max_blob_size(10_000_000)
        .max_data_in_blob(1_000)
        .work_dir(std::env::temp_dir().join("pearl_benchmark"))
        .build()
        .unwrap();

Methods

impl Builder[src]

#[must_use] pub fn new() -> Self[src]

Create new unitialized Builder

pub fn build<K>(self) -> Result<Storage<K>>[src]

Creates Storage based on given configuration, returns error if not all params are set.

Errors

Return error if some of the required params is missed

pub fn work_dir<S: Into<PathBuf>>(self, work_dir: S) -> Self[src]

Sets working directory. If path doesn't exists, Storage will try to create it at initialization stage.

#[must_use] pub fn max_blob_size(self, max_blob_size: u64) -> Self[src]

Sets blob file size approximate limit. When the file size exceeds it, active blob update is activated. Must be greater than zero

#[must_use] pub fn max_data_in_blob(self, max_data_in_blob: u64) -> Self[src]

Limits max number of records in a single blob. Must be greater than zero

pub fn blob_file_name_prefix<U: Into<String>>(
    self,
    blob_file_name_prefix: U
) -> Self
[src]

Sets blob file name prefix, e.g. if prefix set to hellopearl, files will be named as hellopearl.[N].blob. Where N - index number of file If the prefix is empty, param won't be set.

#[must_use] pub fn allow_duplicates(self) -> Self[src]

Disables check existence of the record on write. Writing becomes faster because there is no additional disk access for searching for duplicates.

#[must_use] pub fn set_filter_config(self, config: BloomConfig) -> Self[src]

Sets custom bloom filter config, if not set, use default values

Trait Implementations

impl Debug for Builder[src]

impl Default for Builder[src]

Auto Trait Implementations

impl RefUnwindSafe for Builder

impl Send for Builder

impl Sync for Builder

impl Unpin for Builder

impl UnwindSafe for Builder

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,