pub fn backup(&self, f: BackupFormat) -> StoreResult<Vec<u8>> {
        let ctx = Context::default();
        let data = match f {
            BackupFormat::Binary => {
                let data = self
                    .db
                    .serialize()
                    .map_err(|e| StoreError::FSMError(AnyError::new(&e)))?;
                data
            }
            BackupFormat::SQL => {
                let mut buf = vec![].writer();

                self.db
                    .backup_to_sql(&ctx, &mut buf)
                    .map_err(|e| StoreError::FSMError(AnyError::new(&e)))?;
                buf.into_inner()
            }
        };
        Ok(data)
    }
// backup wites backup of the node state to dst
backup wites backup of the node state to dst
backup wites backup of the node state to dst
pub fn backup(&self, f: BackupFormat) -> StoreResult<Vec<u8>> {
        let ctx = Context::default();
        let data = match f {
            BackupFormat::Binary => {
                let data = self
                    .db
                    .serialize()
                    .map_err(|e| StoreError::FSMError(AnyError::new(&e)))?;
                data
            }
            BackupFormat::SQL => {
                let mut buf = vec![].writer();
                self.db
                    .backup_to_sql(&ctx, &mut buf)
                    .map_err(|e| StoreError::FSMError(AnyError::new(&e)))?;
                buf.into_inner()
            }
        };
        Ok(data)
    }
pub fn backup ( & self , f : BackupFormat ) -> StoreResult < Vec < u8 > > { let ctx = Context :: default ( ) ; let data = match f { BackupFormat :: Binary => { let data = self . db . serialize ( ) . map_err ( | e | StoreError :: FSMError ( AnyError :: new ( & e ) ) ) ? ; data } BackupFormat :: SQL => { let mut buf = vec ! [ ] . writer ( ) ; self . db . backup_to_sql ( & ctx , & mut buf ) . map_err ( | e | StoreError :: FSMError ( AnyError :: new ( & e ) ) ) ? ; buf . into_inner ( ) } } ; Ok ( data ) }
backup wites backup of the node state to dst
backup wites backup of the node state to dst
&self
f
BackupFormat
&self
f
BackupFormat