lingxia_platform/traits/
secure_store.rs1use crate::error::PlatformError;
2
3pub trait SecureStore: Send + Sync + 'static {
4 fn read(&self, key: &str) -> Result<Option<Vec<u8>>, PlatformError> {
6 Err(PlatformError::NotSupported(format!(
7 "SecureStore::read not implemented for key {}",
8 key
9 )))
10 }
11
12 fn contains(&self, key: &str) -> Result<bool, PlatformError> {
14 Ok(self.read(key)?.is_some())
15 }
16
17 fn write(&self, key: &str, value: &[u8]) -> Result<(), PlatformError> {
19 let _ = (key, value);
20 Err(PlatformError::NotSupported(
21 "SecureStore::write not implemented".to_string(),
22 ))
23 }
24
25 fn delete(&self, key: &str) -> Result<(), PlatformError> {
27 Err(PlatformError::NotSupported(format!(
28 "SecureStore::delete not implemented for key {}",
29 key
30 )))
31 }
32}