[][src]Struct elektra::kdb::KDB

pub struct KDB { /* fields omitted */ }

General methods to access the Key database. For example usage see the Readme.

Methods

impl KDB[src]

pub fn open<'a>() -> Result<Self, KDBError<'a>>[src]

Opens the session with the Key database.

pub fn get<'a>(
    &mut self,
    keyset: &mut KeySet,
    key: &mut StringKey<'a>
) -> Result<bool, KDBError<'a>>
[src]

Retrieve keys in an atomic and universal way. Note that the provided keyset is modified and contains the result. The provided key is used to give a hint about which keys should be retrieved. The return value is true, if the keys were successfully retrieved and false if there were no changes to the keyset.

pub fn set<'a>(
    &mut self,
    keyset: &mut KeySet,
    key: &mut StringKey<'a>
) -> Result<bool, KDBError<'a>>
[src]

Set keys in an atomic and universal way. The provided key is used to give a hint about which keys should be stored. The return value is true on success, and false if there were no changes to the KDB.

Notes

You have to call get with keyset first.

pub fn ensure<'a>(
    &mut self,
    keyset: &mut KeySet,
    key: &mut StringKey<'a>
) -> Result<bool, KDBError<'a>>
[src]

This method can be used the given KDB handle meets certain clauses, specified in contract. The return value is true on success, and false if clauses of the contract are unmet.

pub fn as_ptr(&mut self) -> *mut KDB[src]

Returns the raw pointer of the KDB object. Should be used with caution. In particular, the pointer should only be modified with elektra_sys::kdb* functions, but kdbClose should not be called.

Trait Implementations

impl AsRef<_KDB> for KDB[src]

impl Drop for KDB[src]

impl Debug for KDB[src]

Auto Trait Implementations

impl !Sync for KDB

impl !Send for KDB

impl Unpin for KDB

impl UnwindSafe for KDB

impl RefUnwindSafe for KDB

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]