[−][src]Struct eyros::Setup
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: U
fields: SetupFields
Methods
impl<S, U> Setup<S, U> where
S: RandomAccess<Error = Error>,
U: Fn(&str) -> Result<S, Error>,
[src]
S: RandomAccess<Error = Error>,
U: Fn(&str) -> Result<S, Error>,
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]
P: Point,
V: Value,
Auto Trait Implementations
impl<S, U> RefUnwindSafe for Setup<S, U> where
U: RefUnwindSafe,
U: RefUnwindSafe,
impl<S, U> Send for Setup<S, U> where
U: Send,
U: Send,
impl<S, U> Sync for Setup<S, U> where
U: Sync,
U: Sync,
impl<S, U> Unpin for Setup<S, U> where
U: Unpin,
U: Unpin,
impl<S, U> UnwindSafe for Setup<S, U> where
U: UnwindSafe,
U: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,