pub enum UnitPayload {
Bytes(Vec<u8>),
Delta {
base_path: String,
delta: Vec<u8>,
expected: Vec<u8>,
},
}Expand description
What a stored unit holds. The two arms correspond exactly to the two
[ChunkSource] arms the reader knows about — this is the write side of the
same seam, which is the whole point of moving it here.
Variants§
Bytes(Vec<u8>)
Store these bytes as an ordinary chunk.
Delta
Store this diff; the reader applies it to base_path’s bytes.
expected is the bytes the diff must produce. It is not stored as such —
its blake3 is, as the unit’s checksum — and that is the property that
pins a delta chain’s answer (see [ChunkSource]).
Auto Trait Implementations§
impl Freeze for UnitPayload
impl RefUnwindSafe for UnitPayload
impl Send for UnitPayload
impl Sync for UnitPayload
impl Unpin for UnitPayload
impl UnsafeUnpin for UnitPayload
impl UnwindSafe for UnitPayload
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more