Skip to main content

detsys_ids_client/storage/
generic.rs

1#[derive(Default)]
2pub struct Generic {
3    state: Option<super::StoredProperties>,
4}
5
6impl super::Storage for Generic {
7    type Error = std::convert::Infallible;
8
9    async fn load(&self) -> Result<Option<super::StoredProperties>, Self::Error> {
10        Ok(self.state.clone())
11    }
12
13    async fn store(&mut self, properties: super::StoredProperties) -> Result<(), Self::Error> {
14        self.state = Some(properties);
15        Ok(())
16    }
17}