use spvirit_codec::spvd_decode::{DecodedValue, StructureDesc};
use spvirit_types::NtPayload;
use tokio::sync::mpsc;
pub trait PvStore: Send + Sync + 'static {
fn has_pv(&self, name: &str) -> impl Future<Output = bool> + Send;
fn get_snapshot(&self, name: &str) -> impl Future<Output = Option<NtPayload>> + Send;
fn get_descriptor(&self, name: &str) -> impl Future<Output = Option<StructureDesc>> + Send;
fn put_value(
&self,
name: &str,
value: &DecodedValue,
) -> impl Future<Output = Result<Vec<(String, NtPayload)>, String>> + Send;
fn is_writable(&self, name: &str) -> impl Future<Output = bool> + Send;
fn list_pvs(&self) -> impl Future<Output = Vec<String>> + Send;
fn subscribe(
&self,
name: &str,
) -> impl Future<Output = Option<mpsc::Receiver<NtPayload>>> + Send;
}