-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
One possible solution for RustAudio/lewton#84 requires to look ahead future packets. This issue is for discussing the API and internal design.
My idea is as follows:
- Add a function like this:
PacketReader::peeking_reader<'a>(&'a mut self) -> PeekingPacketReader<'a>
This way, we cannot use the originalPacketReaderwhile usingPeekingPacketReader. PeekingPacketReaderprovides subset functions of those ofPacketReader:into_inner,read_packetandread_packet_expected. (and possiblydelete_unread_packets?)- When a
PeekingPacketReaderis generated, it stores the current position of underlying reader, which will be restored when thePeekingPacketReaderis dropped.- Alternatively, we can store all the loaded packets into
PacketReaderand yield them first after the Peeking one is invalidated. This way, we don't have to rely on base reader'sSeekableness.
- Alternatively, we can store all the loaded packets into
How do you think?
Metadata
Metadata
Assignees
Labels
No labels