pub fn prepare(&self) -> Result<(), ObjectReceiveError> {
        // mark the objects as being received; if any of the object IDs is already marked
        // as being received, this will return an error; this is to make sure we don't try
        // to receive the same object twice (e.g. from two different peers)
        self.add_to_receiving()?;

        // make sure the objects are not already in the store
        let plasma_object_ids = map_object_ids(&self.object_ids);
        let in_store = self
            .plasma_client
            .contains_many(&plasma_object_ids)
            .map_err(|err| ObjectReceiveError::StoreError(self.peer_addr, err))?;
        if !in_store.is_empty() {
            let in_store = in_store
                .into_iter()
                .map(|oid| oid.to_bytes().try_into().unwrap())
                .collect();
            return Err(ObjectReceiveError::AlreadyInStore(self.peer_addr, in_store));
        }
        Ok(())
    }
/// Prepares this receiver for receiving objects from the specified peer.
///
/// Will return an error if:
/// * Some of the objects are currently being received as a part of a different request.
/// * Some of the objects are already present in the local plasma store.
Prepares this receiver for receiving objects from the specified peer.
Will return an error if:
Some of the objects are currently being received as a part of a different request.
Some of the objects are already present in the local plasma store.
Prepares this receiver for receiving objects from the specified peer . Will return an error if : Some of the objects are currently being received as a part of a different request . Some of the objects are already present in the local plasma store .
pub fn prepare(&self) -> Result<(), ObjectReceiveError> {
        // mark the objects as being received; if any of the object IDs is already marked
        // as being received, this will return an error; this is to make sure we don't try
        // to receive the same object twice (e.g. from two different peers)
        self.add_to_receiving()?;
        // make sure the objects are not already in the store
        let plasma_object_ids = map_object_ids(&self.object_ids);
        let in_store = self
            .plasma_client
            .contains_many(&plasma_object_ids)
            .map_err(|err| ObjectReceiveError::StoreError(self.peer_addr, err))?;
        if !in_store.is_empty() {
            let in_store = in_store
                .into_iter()
                .map(|oid| oid.to_bytes().try_into().unwrap())
                .collect();
            return Err(ObjectReceiveError::AlreadyInStore(self.peer_addr, in_store));
        }
        Ok(())
    }
pub fn prepare ( & self ) -> Result < ( ) , ObjectReceiveError > { // mark the objects as being received; if any of the object IDs is already marked // as being received, this will return an error; this is to make sure we don't try // to receive the same object twice (e.g. from two different peers) self . add_to_receiving ( ) ? ; // make sure the objects are not already in the store let plasma_object_ids = map_object_ids ( & self . object_ids ) ; let in_store = self . plasma_client . contains_many ( & plasma_object_ids ) . map_err ( | err | ObjectReceiveError :: StoreError ( self . peer_addr , err ) ) ? ; if ! in_store . is_empty ( ) { let in_store = in_store . into_iter ( ) . map ( | oid | oid . to_bytes ( ) . try_into ( ) . unwrap ( ) ) . collect ( ) ; return Err ( ObjectReceiveError :: AlreadyInStore ( self . peer_addr , in_store ) ) ; } Ok ( ( ) ) }
Prepares this receiver for receiving objects from the specified peer.
Prepares this receiver for receiving objects from the specified peer .
&self
&self