Skip to main content

PatchSource

Trait PatchSource 

Source
pub trait PatchSource {
    // Required method
    fn read(&mut self, patch: u32, offset: u64, dst: &mut [u8]) -> Result<()>;
}
Expand description

Source of patch-file bytes for an IndexApplier.

Implementations must fill dst completely with dst.len() source bytes starting at offset in the patch identified by patch. A short read — fewer than dst.len() bytes available — must surface as ZiPatchError::PatchSourceTooShort, not as a partial fill. An out-of-range patch must surface as ZiPatchError::PatchIndexOutOfRange.

Required Methods§

Source

fn read(&mut self, patch: u32, offset: u64, dst: &mut [u8]) -> Result<()>

Fill dst with dst.len() source bytes starting at offset in the patch indexed by patch.

§Errors

Implementors§