pub fn write_payload<P: BoxProvider>(&self, key: &Key<P>, data: &[u8]) -> crate::Result<Vec<WriteRequest>> {
        let id = self.force_typed::<DataTransaction>().id;
        let payload: SealedPayload = data
            .to_vec()
            .encrypt(key, id.as_ref())
            .expect("Failed to encrypt payload");
        Ok(vec![
            WriteRequest::payload(id, payload),
            WriteRequest::transaction(self.sealed()),
        ])
    }
/// create a set of write requests
create a set of write requests
create a set of write requests
pub fn write_payload<P: BoxProvider>(&self, key: &Key<P>, data: &[u8]) -> crate::Result<Vec<WriteRequest>> {
        let id = self.force_typed::<DataTransaction>().id;
        let payload: SealedPayload = data
            .to_vec()
            .encrypt(key, id.as_ref())
            .expect("Failed to encrypt payload");
        Ok(vec![
            WriteRequest::payload(id, payload),
            WriteRequest::transaction(self.sealed()),
        ])
    }
pub fn write_payload < P : BoxProvider > ( & self , key : & Key < P > , data : & [ u8 ] ) -> crate :: Result < Vec < WriteRequest > > { let id = self . force_typed :: < DataTransaction > ( ) . id ; let payload : SealedPayload = data . to_vec ( ) . encrypt ( key , id . as_ref ( ) ) . expect ( " " ) ; Ok ( vec ! [ WriteRequest payload ( id payload ) WriteRequest transaction ( self sealed ( ) ) ] ) }
create a set of write requests
create a set of write requests
&self
key
&Key<P>
data
&[u8]