This commit is contained in:
2025-10-28 15:38:00 -07:00
parent ac1cc76b37
commit 7f16427d50
3 changed files with 437 additions and 8 deletions
+19
View File
@@ -203,3 +203,22 @@ impl<R: std::io::Read> std::io::Read for Decoder<'_, '_, R> {
self.readout(outbuf)
}
}
pub(crate) struct Encoder<'w, 'c, W: std::io::Write> {
writer: &'w mut W,
ctx: &'c mut Ctx,
}
impl<'w, 'c, W: std::io::Write> Encoder<'w, 'c, W> {
pub(crate) fn new(writer: &'w mut W, ctx: &'c mut Ctx) -> Self {
Self { writer, ctx }
}
pub fn encode_checkpoint(mut self, checkpoint: &[u8], frame: u64) -> std::io::Result<u32> {
use rmp::encode as r;
r::write_uint(&mut self.writer, u64::from(u8::from(SSToken::Start)))?;
r::write_uint(&mut self.writer, frame)?;
todo!();
Ok(0)
}
}