zrip_core/push.rs
1//! Types shared by the push encoder and decoder.
2
3/// What a push encoder or decoder needs next.
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub enum Status {
6 /// All input was consumed and all output delivered; pass more input.
7 NeedsInput,
8 /// The output buffer is full and more output is pending; call again with
9 /// more room.
10 NeedsOutput,
11 /// A frame ended and all of its output was delivered.
12 Finished,
13}
14
15/// Result of one push call.
16#[derive(Debug, Clone, Copy, PartialEq, Eq)]
17pub struct Progress {
18 /// Input bytes consumed.
19 pub consumed: usize,
20 /// Output bytes written.
21 pub produced: usize,
22 /// What the caller should do next.
23 pub status: Status,
24}