pub fn assimilate_rand(&self, others: &[Id]) {
        // pick a random chain and load it.
        let other = others[CRng::usize(others.len())];
        let ids = connection::send_until_success(TransactionRequest::List).list();
        let db = DBView::load(self.key.clone(), vault::ListResult::new(ids.into()))
            .expect(line_error!());

        // take ownership of the foriegn chain
        let (to_write, to_delete) = db
            .writer(self.id)
            .take_ownership(&other)
            .expect(line_error!());
        to_write.into_iter().for_each(|req| {
            connection::send_until_success(TransactionRequest::Write(req.clone()));
        });
        to_delete.into_iter().for_each(|req| {
            connection::send_until_success(TransactionRequest::Delete(req.clone()));
        });
    }
// Assimilates a chain owned by another.
Assimilates a chain owned by another.
Assimilates a chain owned by another .
pub fn assimilate_rand(&self, others: &[Id]) {
        // pick a random chain and load it.
        let other = others[CRng::usize(others.len())];
        let ids = connection::send_until_success(TransactionRequest::List).list();
        let db = DBView::load(self.key.clone(), vault::ListResult::new(ids.into()))
            .expect(line_error!());
        // take ownership of the foriegn chain
        let (to_write, to_delete) = db
            .writer(self.id)
            .take_ownership(&other)
            .expect(line_error!());
        to_write.into_iter().for_each(|req| {
            connection::send_until_success(TransactionRequest::Write(req.clone()));
        });
        to_delete.into_iter().for_each(|req| {
            connection::send_until_success(TransactionRequest::Delete(req.clone()));
        });
    }
pub fn assimilate_rand ( & self , others : & [ Id ] ) { // pick a random chain and load it. let other = others [ CRng :: usize ( others . len ( ) ) ] ; let ids = connection :: send_until_success ( TransactionRequest :: List ) . list ( ) ; let db = DBView :: load ( self . key . clone ( ) , vault :: ListResult :: new ( ids . into ( ) ) ) . expect ( line_error ! ( ) ) ; // take ownership of the foriegn chain let ( to_write , to_delete ) = db . writer ( self . id ) . take_ownership ( & other ) . expect ( line_error ! ( ) ) ; to_write . into_iter ( ) . for_each ( | req | { connection :: send_until_success ( TransactionRequest :: Write ( req . clone ( ) ) ) ; } ) ; to_delete . into_iter ( ) . for_each ( | req | { connection :: send_until_success ( TransactionRequest :: Delete ( req . clone ( ) ) ) ; } ) ; }
Assimilates a chain owned by another.
Assimilates a chain owned by another .
&self
others
&[Id]