pub struct SqlitePresetStore { /* private fields */ }Expand description
Durable named preset store sharing the configured server state database.
Implementations§
Source§impl SqlitePresetStore
impl SqlitePresetStore
Sourcepub async fn open(path: &Path) -> Result<Self, BridgeError>
pub async fn open(path: &Path) -> Result<Self, BridgeError>
Opens the preset store and applies its idempotent schema.
Sourcepub async fn create(
&self,
create: ImagePresetCreate,
now: u64,
) -> Result<ImagePreset, BridgeError>
pub async fn create( &self, create: ImagePresetCreate, now: u64, ) -> Result<ImagePreset, BridgeError>
Creates a preset and returns a conflict when the name already exists.
Sourcepub async fn get(&self, name: &str) -> Result<ImagePreset, BridgeError>
pub async fn get(&self, name: &str) -> Result<ImagePreset, BridgeError>
Returns one preset by exact name.
Sourcepub async fn list(
&self,
after: Option<String>,
limit: usize,
) -> Result<Vec<ImagePreset>, BridgeError>
pub async fn list( &self, after: Option<String>, limit: usize, ) -> Result<Vec<ImagePreset>, BridgeError>
Lists presets in stable name order after an optional exclusive cursor.
Sourcepub async fn replace(
&self,
name: &str,
write: ImagePresetWrite,
now: u64,
) -> Result<ImagePreset, BridgeError>
pub async fn replace( &self, name: &str, write: ImagePresetWrite, now: u64, ) -> Result<ImagePreset, BridgeError>
Replaces an existing preset without changing its name or creation time.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SqlitePresetStore
impl RefUnwindSafe for SqlitePresetStore
impl Send for SqlitePresetStore
impl Sync for SqlitePresetStore
impl Unpin for SqlitePresetStore
impl UnsafeUnpin for SqlitePresetStore
impl UnwindSafe for SqlitePresetStore
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