Trait WasmRepository

Source
pub(crate) trait WasmRepository<T> {
    // Required methods
    async fn get(&self, id: String) -> Result<JsValue, JsValue>;
    async fn list(&self) -> Result<JsValue, JsValue>;
    async fn set(&self, id: String, value: T) -> Result<JsValue, JsValue>;
    async fn remove(&self, id: String) -> Result<JsValue, JsValue>;
}
Expand description

This trait defines the methods that a ::wasm_bindgen repository must implement. The trait itself exists to provide a generic way of handling the ::wasm_bindgen interface, which is !Send + !Sync, and only deals with JsValue.

Required Methods§

Source

async fn get(&self, id: String) -> Result<JsValue, JsValue>

Source

async fn list(&self) -> Result<JsValue, JsValue>

Source

async fn set(&self, id: String, value: T) -> Result<JsValue, JsValue>

Source

async fn remove(&self, id: String) -> Result<JsValue, JsValue>

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§