Skip to main content

Crate atom_file

Crate atom_file 

Source
Expand description

AtomicFile provides buffered concurrent access to files with async atomic commit.

BasicAtomicFile is a non-async alternative.

MultiFileStorage is the recommended backing storage for AtomicFile.

FastFileStorage is the recommended temporary storage for AtomicFile.

§Features

This crate supports the following cargo features:

  • pstd : Use pstd crate for BTreeMap (allocated in GTemp).
  • unsafe-optim : Enable unsafe optimisations in release mode.

Modules§

gvec
A contiguous growable array type with heap-allocated contents, written Vec<T>.

Macros§

gvec
Creates a Vec containing the arguments.

Structs§

AnyFileStorage
Alternative to SimpleFileStorage that uses multiple SimpleFileStorages to allow parallel reads by different threads.
Arc
A thread-safe reference-counting pointer. ‘Arc’ stands for ‘Atomically Reference Counted’.
AtomicFile
Based on BasicAtomicFile which makes sure that updates are all-or-nothing. Performs commit asyncronously.
BTreeMap
An ordered map based on a B-Tree.
BasicAtomicFile
Basis for crate::AtomicFile ( non-async alternative ). Provides two-phase commit and buffering of writes.
DummyFile
Dummy Stg that can be used for Atomic upd file if “reliable” atomic commits are not required.
GVec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.
Limits
Memory configuration limits for AtomicFile.
MemFile
Simple implementation of Storage using Arc<Mutex<Vec<u8>>.
PVec
A contiguous growable array type, written as Vec<T>, short for ‘vector’.
SimpleFileStorage
Simple implementation of Storage using std::fs::File.
UnixFileStorage
Optimized implementation of Storage ( unix only ).
UpdFileStorage
For atomic upd file, if not unix or windows.

Traits§

BasicStorage
Storage interface - BasicStorage is some kind of “file” storage.
Storage
BasicStorage with Sync and clone.

Type Aliases§

Data
Arc<Vec<u8>>
FastFileStorage
Fast Storage for upd file ( varies according to platform ).
MultiFileStorage
Optimised Storage ( varies according to platform ).