pub trait Sequence: Send + Sync {
// Required method
fn next_item(&self, cx: &mut Cx) -> Result<Option<SequenceItem>>;
// Provided methods
fn close(&self, _cx: &mut Cx) -> Result<()> { ... }
fn peek_item(&self, _cx: &mut Cx) -> Result<Option<SequenceItem>> { ... }
fn is_done(&self, _cx: &mut Cx) -> Result<bool> { ... }
}Expand description
Pull-based iteration protocol over runtime values.
Required Methods§
Provided Methods§
Sourcefn close(&self, _cx: &mut Cx) -> Result<()>
fn close(&self, _cx: &mut Cx) -> Result<()>
Releases resources backing the sequence; idempotent by default.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".