Struct gdbm::Gdbm
[−]
[src]
pub struct Gdbm { /* fields omitted */ }
Methods
impl Gdbm
[src]
fn new(
path: &Path,
block_size: u32,
flags: Flags,
mode: i32
) -> Result<Gdbm, GdbmError>
path: &Path,
block_size: u32,
flags: Flags,
mode: i32
) -> Result<Gdbm, GdbmError>
Open a DBM with location. mode (see http://www.manpagez.com/man/2/chmod, and http://www.manpagez.com/man/2/open), which is used if the file is created).
fn store(&self, key: &str, content: &mut String, flag: StoreFlags) -> i32
This function returns either -1, 0 or +1. -1 means the item was not stored. 0 means it was stored and +1 means it was not stored because the key already existed. See the link below for more details. http://www.gnu.org.ua/software/gdbm/manual/gdbm.html#Store
fn fetch(&self, key: &str) -> Result<String, GdbmError>
Retrieve a key from the database
fn delete(&self, key: &str) -> bool
Delete a key and value from the database
fn sync(&self)
fn exists(&self, key: &str) -> Result<bool, GdbmError>
Check to see if a key exists in the database
fn fdesc(&self) -> c_int
With locking disabled (if gdbm_open was called with ‘GDBM_NOLOCK’), the user may want to perform their own file locking on the database file in order to prevent multiple writers operating on the same file simultaneously.