pub async fn commit(&self, storage: sled::Db) -> Result<()> {
        let tokens = self.get_all_tokens();
        let ref_tokens: Vec<TokenData> =
            tokens.into_iter().map(|v| v.as_ref().clone()).collect();

        atomic_store(storage, KEYSPACE, ref_tokens).await?;

        Ok(())
    }
/// Saves and changes to the token state to persistent storage.
Saves and changes to the token state to persistent storage.
Saves and changes to the token state to persistent storage .
pub async fn commit(&self, storage: sled::Db) -> Result<()> {
        let tokens = self.get_all_tokens();
        let ref_tokens: Vec<TokenData> =
            tokens.into_iter().map(|v| v.as_ref().clone()).collect();
        atomic_store(storage, KEYSPACE, ref_tokens).await?;
        Ok(())
    }
pub async fn commit ( & self , storage : sled :: Db ) -> Result < ( ) > { let tokens = self . get_all_tokens ( ) ; let ref_tokens : Vec < TokenData > = tokens . into_iter ( ) . map ( | v | v . as_ref ( ) . clone ( ) ) . collect ( ) ; atomic_store ( storage , KEYSPACE , ref_tokens ) . await ? ; Ok ( ( ) ) }
Saves and changes to the token state to persistent storage.
Saves and changes to the token state to persistent storage .
&self
storage
sled::Db
&self
storage
sled::Db