pub struct Decoder<'a> { /* private fields */ }Expand description
Push-driven SHA-1/SHA-256 pack decoder with fixed inline state and one caller-owned 32 KiB inflate window. Neither input nor output is retained. Supports plain, offset-delta and reference-delta entries, including thin packs; checking base existence and graph connectivity is a host operation.
Preserve the unconsumed input suffix between calls. EntryEnd can include
the final body fragment in written; persist it before handling the event.
Every error is terminal, and all previously staged data must be discarded.
No ref may be published before Finished and host object/graph validation.
Implementations§
Source§impl<'a> Decoder<'a>
impl<'a> Decoder<'a>
pub fn new( format: ObjectFormat, window: &'a mut [u8; 32768], limits: DecodeLimits, ) -> Decoder<'a>
pub fn position(&self) -> u64
Sourcepub fn update(
&mut self,
input: &[u8],
output: &mut [u8],
end_of_input: bool,
) -> Result<DecodeProgress, Error>
pub fn update( &mut self, input: &[u8], output: &mut [u8], end_of_input: bool, ) -> Result<DecodeProgress, Error>
end_of_input asserts that this slice contains the final available
bytes. Events and output exhaustion can return before consuming it all;
resubmit the remaining suffix with the same flag. A request for more
input at EOF is an error. Bytes after the trailer are always rejected.