Skip to main content

DeltaWriter

Trait DeltaWriter 

Source
pub trait DeltaWriter {
    // Required methods
    fn emit_len(&mut self, value: usize, base: bool);
    fn emit_literal(&mut self, data: &[u8]);
    fn emit_copy(&mut self, offset: u32, length: u32);
    fn len(&self) -> usize;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

A writer for delta instructions

Required Methods§

Source

fn emit_len(&mut self, value: usize, base: bool)

Emits a length prefix for either the base or target.

Source

fn emit_literal(&mut self, data: &[u8])

Emits a literal insert instruction with the given data.

Source

fn emit_copy(&mut self, offset: u32, length: u32)

Emits a copy instruction with the given offset and length.

Source

fn len(&self) -> usize

Returns the total length of the emitted delta instructions.

Provided Methods§

Source

fn is_empty(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl DeltaWriter for Vec<u8>

Source§

fn emit_literal(&mut self, data: &[u8])

Source§

fn emit_copy(&mut self, offset: u32, length: u32)

Source§

fn len(&self) -> usize

Source§

fn emit_len(&mut self, value: usize, _base: bool)

Implementors§