Skip to content

Commit 55e16d5

Browse files
committed
io_base: implement Seek for InputHandle
This will be needed by the new spx2html engine that will be added shortly. It needs to use `XdvParser::process_with_seeks()` on its input file.
1 parent 8931a3c commit 55e16d5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

crates/io_base/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,13 @@ impl Read for InputHandle {
274274
}
275275
}
276276

277+
impl Seek for InputHandle {
278+
fn seek(&mut self, pos: SeekFrom) -> io::Result<u64> {
279+
self.try_seek(pos)
280+
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))
281+
}
282+
}
283+
277284
impl InputFeatures for InputHandle {
278285
fn get_size(&mut self) -> Result<usize> {
279286
self.inner.get_size()

0 commit comments

Comments
 (0)