pub struct Encoder<T> { /* private fields */ }Expand description
Encodes window edits into frame payloads, deciding where the group boundaries fall.
The track-free core of Producer. It owns the retained window, so it can
restate it whenever a group rolls; that restatement is the whole point of the mode, and is what
an append-only log cannot do.
Frames must reach the wire in the order they were encoded, and a frame with
keyframe set must open a new group: both the positional indices and the
group-scoped DEFLATE window depend on it.
Implementations§
Source§impl<T> Encoder<T>
impl<T> Encoder<T>
Sourcepub fn new(config: ProducerConfig) -> Self
pub fn new(config: ProducerConfig) -> Self
Create an encoder with an empty window, so the first edit opens a group.
Sourcepub fn window(&self) -> Vec<Value>
pub fn window(&self) -> Vec<Value>
The retained window, oldest first.
The encoder holds this to restate it on a roll, so a caller needs no parallel copy.
Auto Trait Implementations§
impl<T> Freeze for Encoder<T>
impl<T> RefUnwindSafe for Encoder<T>
impl<T> Send for Encoder<T>
impl<T> Sync for Encoder<T>
impl<T> Unpin for Encoder<T>
impl<T> UnsafeUnpin for Encoder<T>
impl<T> UnwindSafe for Encoder<T>
Blanket Implementations§
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