use crate::error::PlatformError;
pub trait SecureStore: Send + Sync + 'static {
fn read(&self, key: &str) -> Result<Option<Vec<u8>>, PlatformError> {
Err(PlatformError::NotSupported(format!(
"SecureStore::read not implemented for key {}",
key
)))
}
fn contains(&self, key: &str) -> Result<bool, PlatformError> {
Ok(self.read(key)?.is_some())
}
fn write(&self, key: &str, value: &[u8]) -> Result<(), PlatformError> {
let _ = (key, value);
Err(PlatformError::NotSupported(
"SecureStore::write not implemented".to_string(),
))
}
fn delete(&self, key: &str) -> Result<(), PlatformError> {
Err(PlatformError::NotSupported(format!(
"SecureStore::delete not implemented for key {}",
key
)))
}
}