(e: TxnsEntry)
| 359 | } |
| 360 | |
| 361 | fn encode(e: TxnsEntry) -> (Self::Key, Self::Val) { |
| 362 | let row = match &e { |
| 363 | TxnsEntry::Register(data_id, ts) => Row::pack([ |
| 364 | Datum::from(data_id.to_string().as_str()), |
| 365 | Datum::from(u64::from_le_bytes(*ts)), |
| 366 | Datum::Null, |
| 367 | ]), |
| 368 | TxnsEntry::Append(data_id, ts, batch) => Row::pack([ |
| 369 | Datum::from(data_id.to_string().as_str()), |
| 370 | Datum::from(u64::from_le_bytes(*ts)), |
| 371 | Datum::from(batch.as_slice()), |
| 372 | ]), |
| 373 | }; |
| 374 | (SourceData(Ok(row)), ()) |
| 375 | } |
| 376 | |
| 377 | fn decode(row: SourceData, _: ()) -> TxnsEntry { |
| 378 | let mut datums = row.0.as_ref().expect("valid entry").iter(); |
nothing calls this directly
no test coverage detected