ManagerExt

Trait ManagerExt 

Source
pub trait ManagerExt<R: Runtime>: Manager<R> {
    // Provided methods
    fn store_collection(&self) -> State<'_, StoreCollection<R, DefaultMarker>> { ... }
    fn store_collection_with_marker<C>(
        &self,
    ) -> State<'_, StoreCollection<R, C>>
       where C: CollectionMarker { ... }
    fn with_store<F, T>(&self, id: impl AsRef<str>, f: F) -> Result<T>
       where F: FnOnce(&mut Store<R, DefaultMarker>) -> T { ... }
}
Expand description

Extension for the Manager trait providing access to the store collection.

Provided Methods§

Source

fn store_collection(&self) -> State<'_, StoreCollection<R, DefaultMarker>>

Returns a handle to the default store collection.

§Panics

Panics if the store collection is not yet being managed by Tauri.

This likely indicates it was called before the plugin was properly initialized.

Source

fn store_collection_with_marker<C>(&self) -> State<'_, StoreCollection<R, C>>

Returns a handle to the store collection for the specified marker.

§Panics

Panics if the store collection is not yet being managed by Tauri.

This likely indicates it was called before the plugin was properly initialized.

Source

fn with_store<F, T>(&self, id: impl AsRef<str>, f: F) -> Result<T>
where F: FnOnce(&mut Store<R, DefaultMarker>) -> T,

Calls a closure with a mutable reference to the store with the given id.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<R: Runtime, T: Manager<R>> ManagerExt<R> for T