Skip to content

Instantly share code, notes, and snippets.

View Rainb0wCodes's full-sized avatar

Rainbow Rainb0wCodes

  • 16:44 (UTC -07:00)
View GitHub Profile
@Rainb0wCodes
Rainb0wCodes / SeekableStreamWrapper.rs
Created September 26, 2022 02:28
A wrapper for any stream to make it seekable in the forwards direction
/* The following code is licensed under the CC0 1.0 Universal license. Details can be found at http://creativecommons.org/publicdomain/zero/1.0/
To the full extent, I, a Canadian citizen have waived all copyright and related or neighboring rights to this work. */
struct SeekableStreamWrapper<T: Read> {
offset: usize,
inner: T,
}
impl<T> Read for SeekableStreamWrapper<T>
where