pub struct SqliteConfigStore { /* private fields */ }Expand description
SQLite-backed config store for gateway management endpoints.
Implementations§
Source§impl SqliteConfigStore
impl SqliteConfigStore
Sourcepub fn open(path: &str) -> Result<Self, StoreError>
pub fn open(path: &str) -> Result<Self, StoreError>
Open (or create) a store at the given file path.
Sourcepub fn open_in_memory() -> Result<Self, StoreError>
pub fn open_in_memory() -> Result<Self, StoreError>
Open a transient in-memory store (useful in tests).
Sourcepub fn set(&self, key: &str, value: &str) -> Result<ConfigEntry, StoreError>
pub fn set(&self, key: &str, value: &str) -> Result<ConfigEntry, StoreError>
Upsert a config key.
Sourcepub fn get(&self, key: &str) -> Result<Option<ConfigEntry>, StoreError>
pub fn get(&self, key: &str) -> Result<Option<ConfigEntry>, StoreError>
Fetch a config key, if present.
Sourcepub fn delete(&self, key: &str) -> Result<bool, StoreError>
pub fn delete(&self, key: &str) -> Result<bool, StoreError>
Delete a config key. Returns true if a row was removed.
Sourcepub fn list(&self) -> Result<Vec<ConfigEntry>, StoreError>
pub fn list(&self) -> Result<Vec<ConfigEntry>, StoreError>
List all config entries ordered by key.
Auto Trait Implementations§
impl !Freeze for SqliteConfigStore
impl RefUnwindSafe for SqliteConfigStore
impl Send for SqliteConfigStore
impl Sync for SqliteConfigStore
impl Unpin for SqliteConfigStore
impl UnsafeUnpin for SqliteConfigStore
impl UnwindSafe for SqliteConfigStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more