Struct gdbm::Gdbm [−][src]
pub struct Gdbm { /* fields omitted */ }
Methods
impl Gdbm
[src]
impl Gdbm
pub fn new(
path: &Path,
block_size: u32,
flags: Flags,
mode: i32
) -> Result<Gdbm, GdbmError>
[src]
pub fn new(
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).
pub fn store(&self, key: &str, content: &mut String, flag: StoreFlags) -> i32
[src]
pub 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
pub fn fetch(&self, key: &str) -> Result<String, GdbmError>
[src]
pub fn fetch(&self, key: &str) -> Result<String, GdbmError>
Retrieve a key from the database
pub fn delete(&self, key: &str) -> bool
[src]
pub fn delete(&self, key: &str) -> bool
Delete a key and value from the database
pub fn sync(&self)
[src]
pub fn sync(&self)
pub fn exists(&self, key: &str) -> Result<bool, GdbmError>
[src]
pub fn exists(&self, key: &str) -> Result<bool, GdbmError>
Check to see if a key exists in the database
pub fn fdesc(&self) -> c_int
[src]
pub 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.
Trait Implementations
impl Debug for Gdbm
[src]
impl Debug for Gdbm
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Drop for Gdbm
[src]
impl Drop for Gdbm