| 449 | |
| 450 | #[cfg(test)] |
| 451 | pub fn transactions<'a, D>(self, de: &'a D) -> impl Iterator<Item = Result<Transaction<D::Record>, D::Error>> + 'a |
| 452 | where |
| 453 | D: crate::Decoder, |
| 454 | D::Error: From<io::Error>, |
| 455 | R: 'a, |
| 456 | { |
| 457 | use itertools::Itertools as _; |
| 458 | |
| 459 | self.commits() |
| 460 | .with_log_format_version() |
| 461 | .map(|x| x.map_err(Into::into)) |
| 462 | .map_ok(move |(version, commit)| { |
| 463 | let start = commit.min_tx_offset; |
| 464 | commit.into_transactions(version, start, de) |
| 465 | }) |
| 466 | .flatten_ok() |
| 467 | .map(|x| x.and_then(|y| y)) |
| 468 | } |
| 469 | |
| 470 | #[cfg(test)] |
| 471 | pub(crate) fn metadata(self) -> Result<Metadata, error::SegmentMetadata> { |