diff options
Diffstat (limited to 'matroska/src/read.rs')
-rw-r--r-- | matroska/src/read.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/matroska/src/read.rs b/matroska/src/read.rs index 1211351..c99f304 100644 --- a/matroska/src/read.rs +++ b/matroska/src/read.rs @@ -3,7 +3,7 @@ which is licensed under the GNU Affero General Public License (version 3); see /COPYING. Copyright (C) 2023 metamuffin <metamuffin.org> */ -use crate::{matroska::MatroskaTag, size::EbmlSize, Master}; +use crate::{matroska::MatroskaTag, size::EbmlSize, unflatten::IterWithPos, Master}; use anyhow::{anyhow, bail, Result}; use log::{debug, warn}; use std::{ @@ -159,9 +159,13 @@ impl EbmlReader { } } -impl Iterator for EbmlReader { +impl IterWithPos for EbmlReader { type Item = Result<MatroskaTag>; + fn position(&self) -> usize { + self.position + } + fn next(&mut self) -> Option<Self::Item> { if let Some(t) = self.queue.pop_front() { // match t { |