pub trait StreamSink {
// Required methods
fn chunk(&mut self, cx: &mut Cx, frame: ServerFrame) -> Result<()>;
fn end(&mut self, cx: &mut Cx) -> Result<()>;
}Expand description
Receiver for streamed server frames produced by EvalSite::stream.
Required Methods§
Sourcefn chunk(&mut self, cx: &mut Cx, frame: ServerFrame) -> Result<()>
fn chunk(&mut self, cx: &mut Cx, frame: ServerFrame) -> Result<()>
Accept one streamed server frame.
The default EvalSite::stream compatibility path may pass a
FrameKind::Response reply through this method. Real streaming sites
should emit FrameKind::StreamStart, FrameKind::StreamChunk, and
FrameKind::StreamEnd frames instead.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".