[−][src]Struct kv::Config
Config is used to create a new store
Fields
map_size: usize
The map_size
field determines the maximum number of bytes stored in the database
max_readers: u32
The max_readers
field determines the maximum number of readers for a given database
path: PathBuf
The path
field determines where the database will be created
readonly: bool
Readonly sets the MDB_RDONLY flag when opening the database
buckets: HashMap<String, Flag>
Whitelisted buckets and DatabaseFlags
Methods
impl Config
[src]
pub fn default<P: AsRef<Path>>(p: P) -> Config
[src]
Create a default configuration object
pub fn save_to<W: Write>(&self, w: W) -> Result<(), Error>
[src]
Save Config to an io::Write
pub fn save<P: AsRef<Path>>(&self, path: P) -> Result<(), Error>
[src]
Save Config to a file
pub fn load_from<R: Read>(r: R) -> Result<Config, Error>
[src]
Load configuration from an io::Read
pub fn load<P: AsRef<Path>>(path: P) -> Result<Config, Error>
[src]
Load configuration to a file
pub fn set_map_size(&mut self, n: usize) -> &mut Config
[src]
Set map_size
field
pub fn set_max_readers(&mut self, n: u32) -> &mut Config
[src]
Set max_readers
field
pub fn flags(&self) -> EnvironmentFlags
[src]
Get flags
field (DatabaseFlags)
pub fn flag(&mut self, f: EnvironmentFlags) -> &mut Config
[src]
Set flags
field (DatabaseFlags)
pub fn set_path<P: AsRef<Path>>(&mut self, p: P) -> &mut Config
[src]
Set path
field
pub fn bucket<S: AsRef<str>>(&mut self, name: S, f: Option<Flag>) -> &mut Config
[src]
Add a bucket
pub fn readonly(&mut self, readonly: bool) -> &mut Config
[src]
Set to readonly
Trait Implementations
impl Clone for Config
[src]
impl Debug for Config
[src]
impl<'de> Deserialize<'de> for Config
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl PartialEq<Config> for Config
[src]
impl Serialize for Config
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Config
[src]
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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>,