pub async fn serialize(&self, mut writer: impl Write + Unpin) -> Result<()> {
        let db = (self.store.read().await).clone();
        println!("{}", serde_json::to_string_pretty(&db)?);
        let buf = task::spawn_blocking(move || {
            serde_json::to_string(&db)
                .expect("Couldn't serialize data store")
                .into_bytes()
        })
        .await;
        writer.write_all(&buf).await.map_err(|e| e.into())
    }
///
/// Serializes the store using the provided (async_std) writer
///
Serializes the store using the provided (async_std) writer
Serializes the store using the provided ( async_std ) writer
pub async fn serialize(&self, mut writer: impl Write + Unpin) -> Result<()> {
        let db = (self.store.read().await).clone();
        println!("{}", serde_json::to_string_pretty(&db)?);
        let buf = task::spawn_blocking(move || {
            serde_json::to_string(&db)
                .expect("Couldn't serialize data store")
                .into_bytes()
        })
        .await;
        writer.write_all(&buf).await.map_err(|e| e.into())
    }
pub async fn serialize ( & self , mut writer : impl Write + Unpin ) -> Result < ( ) > { let db = ( self . store . read ( ) . await ) . clone ( ) ; println ! ( " " serde_json to_string_pretty ( db ) ) ; let buf = task :: spawn_blocking ( move | | { serde_json :: to_string ( & db ) . expect ( " " ) . into_bytes ( ) } ) . await ; writer . write_all ( & buf ) . await . map_err ( | e | e . into ( ) ) }
Serializes the store using the provided (async_std) writer
Serializes the store using the provided ( async_std ) writer
&self
writer
impl Write + Unpin
&self
writer
impl Write + Unpin