lifthrasiir / rust-encoding

Character encoding support for Rust
MIT License
284 stars 59 forks source link

How to Reset a RawDecoder #107

Open yodalee opened 7 years ago

yodalee commented 7 years ago

I'm current working on this issue: https://github.com/servo/servo/issues/13234 To support streaming, I need to use RawDecoder provided by rust-encoding. I add an instance of RawDecoder to TextDecoder, make decode method use interface by RawDecoder. However I found no way to 'reset' the RawDecoder, that is, clear raw decoder's current state and unprocessed buffer. Is that can be done?

lifthrasiir commented 7 years ago

Try RawDecoder::from_self method.