pub struct StreamReader<R: BufRead> { /* private fields */ }Expand description
A streaming SIF reader with full streaming protocol support.
Handles stream lifecycle, multiplexed streams, CDC mode, schema evolution, flow control, and heartbeat.
Implementations§
Source§impl<R: BufRead> StreamReader<R>
impl<R: BufRead> StreamReader<R>
pub fn new(source: R) -> Self
Sourcepub fn active_stream(&self) -> Option<&StreamInfo>
pub fn active_stream(&self) -> Option<&StreamInfo>
Returns the currently active stream info, if any.
Sourcepub fn schema(&self) -> Option<&Schema>
pub fn schema(&self) -> Option<&Schema>
Returns the current schema (from active stream or section).
Sourcepub fn next_event(&mut self) -> Result<Option<StreamEvent>>
pub fn next_event(&mut self) -> Result<Option<StreamEvent>>
Read the next event.
Sourcepub fn collect_events(&mut self) -> Result<Vec<StreamEvent>>
pub fn collect_events(&mut self) -> Result<Vec<StreamEvent>>
Collect all events.
Auto Trait Implementations§
impl<R> Freeze for StreamReader<R>where
R: Freeze,
impl<R> RefUnwindSafe for StreamReader<R>where
R: RefUnwindSafe,
impl<R> Send for StreamReader<R>where
R: Send,
impl<R> Sync for StreamReader<R>where
R: Sync,
impl<R> Unpin for StreamReader<R>where
R: Unpin,
impl<R> UnsafeUnpin for StreamReader<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for StreamReader<R>where
R: UnwindSafe,
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