diff --git a/src/stream/mod.rs b/src/stream/mod.rs index 6ff53317..7d1459b7 100644 --- a/src/stream/mod.rs +++ b/src/stream/mod.rs @@ -129,6 +129,21 @@ where } } +impl Located +where + I: Clone + Stream + Offset, +{ + /// Reset the stream to the start + /// + /// This is useful for formats that encode a graph with addresses relative to the start of the + /// input. + #[doc(alias = "fseek")] + pub fn reset_to_start(&mut self) { + let start = self.initial.checkpoint(); + self.input.reset(&start); + } +} + impl AsRef for Located { #[inline(always)] fn as_ref(&self) -> &I {