Trait ApiService

Source
pub trait ApiService {
    // Required methods
    fn with_config(storage: Storage, config: Arc<Config>) -> Self;
    fn start(
        &self,
        server_shutdown: Arc<AtomicBool>,
        signal_server_ready: Sender<()>,
    ) -> Result<(), String>;
    fn stop(&self);
    fn keys(&self) -> Vec<String>;
    fn set_item(&self, key: &str, item: StorageItem) -> bool;
    fn get_item(&self, key: &str) -> Option<StorageItem>;
    fn remove_item(&self, key: &str) -> bool;
}

Required Methods§

Source

fn with_config(storage: Storage, config: Arc<Config>) -> Self

Source

fn start( &self, server_shutdown: Arc<AtomicBool>, signal_server_ready: Sender<()>, ) -> Result<(), String>

Source

fn stop(&self)

Source

fn keys(&self) -> Vec<String>

Source

fn set_item(&self, key: &str, item: StorageItem) -> bool

Source

fn get_item(&self, key: &str) -> Option<StorageItem>

Source

fn remove_item(&self, key: &str) -> bool

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§