Skip to main content

DeltaExtractor

Trait DeltaExtractor 

Source
pub trait DeltaExtractor: Send {
    // Required methods
    fn on_event(&self, data: &[u8], targets: &mut Targets);
    fn is_terminator(&self, data: &[u8]) -> bool;
    fn synthesize(
        &self,
        repairs: &[Repair],
        targets: &Targets,
        terminated: bool,
    ) -> Vec<u8> ;
}
Expand description

A provider-specific adapter that interprets SSE event payloads, routes JSON delta fragments into Targets, recognises the stream terminator, and synthesizes the closing SSE bytes from computed repairs.

Required Methods§

Source

fn on_event(&self, data: &[u8], targets: &mut Targets)

Interpret one SSE data payload, updating targets.

Source

fn is_terminator(&self, data: &[u8]) -> bool

True if this payload is the provider’s stream terminator.

Source

fn synthesize( &self, repairs: &[Repair], targets: &Targets, terminated: bool, ) -> Vec<u8>

Build the synthetic SSE bytes that close repairs (already filtered to safe, non-noop targets). terminated indicates the upstream already sent its terminator (so we don’t duplicate it).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§