underhill_core/emuplat/
non_volatile_store.rs1use vmcore::non_volatile_store::NonVolatileStore;
7use vmgs_broker::non_volatile_store::EncryptionNotSupported;
8use vmgs_broker::non_volatile_store::VmgsNonVolatileStore;
9
10pub trait VmbsBrokerNonVolatileStore {
12 fn as_non_volatile_store(
15 &self,
16 file_id: vmgs::FileId,
17 encrypted: bool,
18 ) -> Result<Box<dyn NonVolatileStore>, EncryptionNotSupported>;
19}
20
21impl VmbsBrokerNonVolatileStore for vmgs_broker::VmgsClient {
22 fn as_non_volatile_store(
23 &self,
24 file_id: vmgs::FileId,
25 encrypted: bool,
26 ) -> Result<Box<dyn NonVolatileStore>, EncryptionNotSupported> {
27 Ok(Box::new(VmgsNonVolatileStore::new(
28 self.clone(),
29 file_id,
30 encrypted,
31 )?))
32 }
33}