[][src]Struct eyros::Setup

pub struct Setup<S> where
    S: RandomAccess<Error = Error> + Unpin + Send + Sync
{ pub storage: Box<dyn Storage<S>>, 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::from_path(&PathBuf::from("/tmp/eyros-db/"))
  .branch_factor(5)
  .max_data_size(3_000)
  .base_size(1_000)
  .build()
  .await?;

Fields

storage: Box<dyn Storage<S>>fields: SetupFields

Implementations

impl<S> Setup<S> where
    S: RandomAccess<Error = Error> + 'static + Unpin + Send + Sync
[src]

pub fn from_storage(storage: Box<dyn Storage<S>>) -> 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 async fn build<P, V>(self) -> Result<DB<S, P, V>, Error> where
    P: Point + 'static,
    V: Value + 'static, 
[src]

impl Setup<RandomAccessDisk>[src]

pub fn from_path(path: &Path) -> Self[src]

Create a new Setup builder from a string file path.

Auto Trait Implementations

impl<S> !RefUnwindSafe for Setup<S>

impl<S> !Send for Setup<S>

impl<S> !Sync for Setup<S>

impl<S> Unpin for Setup<S>

impl<S> !UnwindSafe for Setup<S>

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.