pub async fn backup(&self) -> Result<Option<OutgoingRequest>, CryptoStoreError> {
        let mut request = self.pending_backup.write().await;

        if let Some(request) = &*request {
            trace!("Backing up, returning an existing request");

            Ok(Some(request.clone().into()))
        } else {
            trace!("Backing up, creating a new request");

            let new_request = self.backup_helper().await?;
            *request = new_request.clone();

            Ok(new_request.map(|r| r.into()))
        }
    }
/// Encrypt a batch of room keys and return a request that needs to be sent
/// out to backup the room keys.
Encrypt a batch of room keys and return a request that needs to be sent
out to backup the room keys.
Encrypt a batch of room keys and return a request that needs to be sent out to backup the room keys .
pub async fn backup(&self) -> Result<Option<OutgoingRequest>, CryptoStoreError> {
        let mut request = self.pending_backup.write().await;
        if let Some(request) = &*request {
            trace!("Backing up, returning an existing request");
            Ok(Some(request.clone().into()))
        } else {
            trace!("Backing up, creating a new request");
            let new_request = self.backup_helper().await?;
            *request = new_request.clone();
            Ok(new_request.map(|r| r.into()))
        }
    }
pub async fn backup ( & self ) -> Result < Option < OutgoingRequest > , CryptoStoreError > { let mut request = self . pending_backup . write ( ) . await ; if let Some ( request ) = & * request { trace ! ( " " ) ; Ok ( Some ( request . clone ( ) . into ( ) ) ) } else { trace ! ( " " ) ; let new_request = self . backup_helper ( ) . await ? ; * request = new_request . clone ( ) ; Ok ( new_request . map ( | r | r . into ( ) ) ) } }
Encrypt a batch of room keys and return a request that needs to be sent
out to backup the room keys.
Encrypt a batch of room keys and return a request that needs to be sent out to backup the room keys .
&self
&self