Struct snapper_box::file::LsmFile [−][src]
Expand description
Implementations
Creates a new LsmFile from the provided, already existing, File like object.
Accepts values for the compression level for the file, the key to be used for encryption/decryption, as well as the maximum number of cache entries before a mandatory flush occurs, which defaults to 100.
Errors
Error::EntryIOif an error occurs while reading the entries- Will bubble up any segment errors`
Retries a value from the store given a key, if the value exists in the store.
The most recently inserted version of the value will be returned
Errors
Will return an error if any IO error occurs, or if the value fails to deserialize.
Inserts an object into the store
This method will write to the cache, however, if this insertion makes the cache size greater than or equal to the maximum number of entries, the current cache will be flushed.
Errors
- Will return an error if either the key or value fail to serialize
- Will bubble up any IO errors that occur, if a flush occurs
pub fn to_hashmap<C, V>(&mut self) -> Result<HashMap<C, V>, Error> where
C: DeserializeOwned + Serialize + Hash + Eq,
V: DeserializeOwned,
pub fn to_hashmap<C, V>(&mut self) -> Result<HashMap<C, V>, Error> where
C: DeserializeOwned + Serialize + Hash + Eq,
V: DeserializeOwned,
Consumes self and returns the inner File like object
Opens an existing LsmFile from the provided path.
Will open the file in read/write mode. Will fail if the file does not exists.
Errors
- If the file does not exist
- If any other IO occurs
- If any of the decryption or deserialization of control structures fails
Opens an existing LsmFile from the provided path.
Will create the file in read/write mode, failing if the file exists
Errors
- If the file already exists
- If any other IO occurs
Auto Trait Implementations
impl<T, K> RefUnwindSafe for LsmFile<T, K> where
K: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, K> UnwindSafe for LsmFile<T, K> where
K: RefUnwindSafe,
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more