[][src]Struct eyros::Setup

pub struct Setup<S, U> where
    S: RandomAccess<Error = Error>,
    U: Fn(&str) -> Result<S, Error>, 
{ pub open_store: U, pub fields: SetupFields, }

Builder to configure and instantiate an eyros database.

The Setup builder lets you create a database with a more custom configuration:

use eyros::{DB,Setup};
use random_access_disk::RandomAccessDisk;
use std::path::PathBuf;

type P = ((f32,f32),(f32,f32));
type V = u32;

let mut db: DB<_,_,P,V> = Setup::new(storage)
  .branch_factor(5)
  .max_data_size(3_000)
  .base_size(1_000)
  .build()?;

fn storage(name: &str) -> Result<RandomAccessDisk,Error> {
  let mut p = PathBuf::from("/tmp/eyros-db/");
  p.push(name);
  Ok(RandomAccessDisk::builder(p).auto_sync(false).build()?)
}

Fields

open_store: Ufields: SetupFields

Methods

impl<S, U> Setup<S, U> where
    S: RandomAccess<Error = Error>,
    U: Fn(&str) -> Result<S, Error>, 
[src]

pub fn new(open_store: U) -> Self[src]

Create a new Setup builder from a storage function.

pub fn branch_factor(self, bf: usize) -> Self[src]

pub fn base_size(self, size: usize) -> Self[src]

pub fn max_data_size(self, size: usize) -> Self[src]

pub fn bbox_cache_size(self, size: usize) -> Self[src]

pub fn data_list_cache_size(self, size: usize) -> Self[src]

pub fn build<P, V>(self) -> Result<DB<S, U, P, V>, Error> where
    P: Point,
    V: Value
[src]

Auto Trait Implementations

impl<S, U> RefUnwindSafe for Setup<S, U> where
    U: RefUnwindSafe

impl<S, U> Send for Setup<S, U> where
    U: Send

impl<S, U> Sync for Setup<S, U> where
    U: Sync

impl<S, U> Unpin for Setup<S, U> where
    U: Unpin

impl<S, U> UnwindSafe for Setup<S, U> where
    U: UnwindSafe

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.