1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use cyfs_base::*;
use async_trait::async_trait;
use std::sync::Arc;
#[async_trait]
pub trait OuterDeviceCache: Sync + Send + 'static {
async fn add(&self, device_id: &DeviceId, device: Device);
async fn get(&self, device_id: &DeviceId) -> Option<Device>;
async fn search(&self, device_id: &DeviceId) -> BuckyResult<Device>;
async fn verfiy_owner(&self, device_id: &DeviceId, device: Option<&Device>) -> BuckyResult<()>;
async fn verfiy_own_signs(&self, object_id: &ObjectId, object: &Arc<AnyNamedObject>) -> BuckyResult<()>;
fn clone_cache(&self) -> Box<dyn OuterDeviceCache>;
}