pub async fn backup(&self, leader: bool, f: BackupFormat) -> StoreResult<Vec<u8>> {
        if leader {
            let req = ForwardRequest {
                forward_to_leader: 1,
                body: ForwardRequestBody::Backup(f.clone()),
            };
            let resp = self.redirect_if_needed(req, leader).await?;
            let data = match resp {
                Some(forward_resp) => match forward_resp {
                    ForwardResponse::Backup(data) => data,
                    _ => panic!("BUG: need AppRsponse"),
                },
                None => {
                    let data = self.fsm.backup(f)?;
                    data
                }
            };
            return Ok(data);
        } else {
            let data = self.fsm.backup(f)?;
            return 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 async fn backup(&self, leader: bool, f: BackupFormat) -> StoreResult<Vec<u8>> {
        if leader {
            let req = ForwardRequest {
                forward_to_leader: 1,
                body: ForwardRequestBody::Backup(f.clone()),
            };
            let resp = self.redirect_if_needed(req, leader).await?;
            let data = match resp {
                Some(forward_resp) => match forward_resp {
                    ForwardResponse::Backup(data) => data,
                    _ => panic!("BUG: need AppRsponse"),
                },
                None => {
                    let data = self.fsm.backup(f)?;
                    data
                }
            };
            return Ok(data);
        } else {
            let data = self.fsm.backup(f)?;
            return Ok(data);
        }
    }
pub async fn backup ( & self , leader : bool , f : BackupFormat ) -> StoreResult < Vec < u8 > > { if leader { let req = ForwardRequest { forward_to_leader : 1 , body : ForwardRequestBody :: Backup ( f . clone ( ) ) , } ; let resp = self . redirect_if_needed ( req , leader ) . await ? ; let data = match resp { Some ( forward_resp ) => match forward_resp { ForwardResponse :: Backup ( data ) => data , _ => panic ! ( " " ) , } , None => { let data = self . fsm . backup ( f ) ? ; data } } ; return Ok ( data ) ; } else { let data = self . fsm . backup ( f ) ? ; return Ok ( data ) ; } }
backup wites backup of the node state to dst
backup wites backup of the node state to dst
&self
leader
bool
f
BackupFormat
&self
leader
bool
f
BackupFormat