[−][src]Struct rkv::Manager
A process is only permitted to have one open handle to each Rkv environment. This manager exists to enforce that constraint: don't open environments directly.
Implementations
impl<'e, E> Manager<E> where
E: BackendEnvironment<'e>,
[src]
E: BackendEnvironment<'e>,
pub fn get<'p, P>(
&self,
path: P
) -> Result<Option<Arc<RwLock<Rkv<E>>>>, StoreError> where
P: Into<&'p Path>,
[src]
&self,
path: P
) -> Result<Option<Arc<RwLock<Rkv<E>>>>, StoreError> where
P: Into<&'p Path>,
Return the open env at path
, returning None
if it has not already been opened.
pub fn get_or_create<'p, F, P>(
&mut self,
path: P,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
[src]
&mut self,
path: P,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
Return the open env at path
, or create it by calling f
.
pub fn get_or_create_with_capacity<'p, F, P>(
&mut self,
path: P,
capacity: c_uint,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path, c_uint) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
[src]
&mut self,
path: P,
capacity: c_uint,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path, c_uint) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
Return the open env at path
with capacity
, or create it by calling f
.
pub fn get_or_create_from_builder<'p, F, P, B>(
&mut self,
path: P,
builder: B,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path, B) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
B: BackendEnvironmentBuilder<'e, Environment = E>,
[src]
&mut self,
path: P,
builder: B,
f: F
) -> Result<Arc<RwLock<Rkv<E>>>, StoreError> where
F: FnOnce(&Path, B) -> Result<Rkv<E>, StoreError>,
P: Into<&'p Path>,
B: BackendEnvironmentBuilder<'e, Environment = E>,
Return a new Rkv environment from the builder, or create it by calling f
.
pub fn try_close_and_delete<'p, P>(&mut self, path: P) -> Result<(), StoreError> where
P: Into<&'p Path>,
[src]
P: Into<&'p Path>,
Tries to close the specified environment and delete all its files from disk. Doesn't delete the folder used when opening the environment. This will only work if there's no other users of this environment.
impl Manager<LmdbEnvironment>
[src]
pub fn singleton() -> &'static RwLock<Manager<LmdbEnvironment>>
[src]
impl Manager<SafeModeEnvironment>
[src]
pub fn singleton() -> &'static RwLock<Manager<SafeModeEnvironment>>
[src]
Auto Trait Implementations
impl<E> RefUnwindSafe for Manager<E>
impl<E> Send for Manager<E> where
E: Send + Sync,
E: Send + Sync,
impl<E> Sync for Manager<E> where
E: Send + Sync,
E: Send + Sync,
impl<E> Unpin for Manager<E>
impl<E> UnwindSafe for Manager<E>
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>,