Server tools to backfill, tail, mirror, and verify PLC logs

refactor apply_op_log to take IntoIterator

ptr.pet 5a65e563 7c0e3f6e

verified
+7 -2
+7 -2
src/doc.rs
··· 206 207 /// apply a sequence of operation JSON blobs and return the current document data. 208 /// returns None if the DID is tombstoned (last op is a tombstone). 209 - pub fn apply_op_log<'a>(did: &'a str, ops: &'a [Value]) -> Option<DocumentData<'a>> { 210 // TODO: we don't verify signature chain, we should do that... 211 - ops.last().and_then(|op| op_to_doc_data(did, op)) 212 } 213 214 #[cfg(test)]
··· 206 207 /// apply a sequence of operation JSON blobs and return the current document data. 208 /// returns None if the DID is tombstoned (last op is a tombstone). 209 + pub fn apply_op_log<'a>( 210 + did: &'a str, 211 + ops: impl IntoIterator<Item = &'a Value>, 212 + ) -> Option<DocumentData<'a>> { 213 // TODO: we don't verify signature chain, we should do that... 214 + ops.into_iter() 215 + .last() 216 + .and_then(|op| op_to_doc_data(did, op)) 217 } 218 219 #[cfg(test)]