pub struct StreamingEncoder { /* private fields */ }Expand description
Streaming encoder for chunked transmission
Implementations§
Source§impl StreamingEncoder
impl StreamingEncoder
Sourcepub fn with_config(config: StreamingConfig) -> Self
pub fn with_config(config: StreamingConfig) -> Self
Creates a new StreamingEncoder with custom configuration
Sourcepub fn begin_stream(&mut self) -> Result<Vec<u8>, StreamingError>
pub fn begin_stream(&mut self) -> Result<Vec<u8>, StreamingError>
Emits a BEGIN frame to start the stream
Sourcepub fn write_chunk(&mut self, data: &[u8]) -> Result<Vec<u8>, StreamingError>
pub fn write_chunk(&mut self, data: &[u8]) -> Result<Vec<u8>, StreamingError>
Segments data and emits CHUNK frames
Sourcepub fn end_stream(&mut self) -> Result<Vec<u8>, StreamingError>
pub fn end_stream(&mut self) -> Result<Vec<u8>, StreamingError>
Emits an END frame to complete the stream
Sourcepub fn error_frame(&mut self, error: &str) -> Result<Vec<u8>, StreamingError>
pub fn error_frame(&mut self, error: &str) -> Result<Vec<u8>, StreamingError>
Emits an ERROR frame
Sourcepub fn state(&self) -> &StreamingState
pub fn state(&self) -> &StreamingState
Returns the current streaming state
Trait Implementations§
Auto Trait Implementations§
impl Freeze for StreamingEncoder
impl RefUnwindSafe for StreamingEncoder
impl Send for StreamingEncoder
impl Sync for StreamingEncoder
impl Unpin for StreamingEncoder
impl UnwindSafe for StreamingEncoder
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