pub trait EventSource {
// Required method
fn next_event(&mut self) -> Result<Option<Event>>;
}Expand description
Produces a stream of crate::Events from a document source.
The pull-based design gives the consumer control: only fetch events when ready to process them. This provides natural backpressure and constant memory usage regardless of document size.
Return Ok(None) to signal the end of the stream. Return Err for fatal
errors that prevent further reading.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".