pub struct Transcript { /* private fields */ }Expand description
A completion stream’s items read back from their serialized form, in an order the writer could have produced: each part starts once, at a position no part took before, grows only while open and with its own kind of fragment, and ends once. Positions follow the order provider items opened, so a dropped item leaves a gap. Unmodeled payloads may come anywhere.
Implementations§
Source§impl Transcript
impl Transcript
Sourcepub fn parse(value: Value) -> Result<Transcript, SequenceError>
pub fn parse(value: Value) -> Result<Transcript, SequenceError>
Read a serialized item sequence, refusing one the writer could not have produced. Every part must have ended.
Sourcepub fn parse_prefix(value: Value) -> Result<Transcript, SequenceError>
pub fn parse_prefix(value: Value) -> Result<Transcript, SequenceError>
Self::parse for a stream that stopped early (an error or a
cancellation): parts may still be open at its end.
Sourcepub fn push(&mut self, item: Item<StreamEvent>) -> Result<(), SequenceError>
pub fn push(&mut self, item: Item<StreamEvent>) -> Result<(), SequenceError>
Append the next item a stream yielded, refusing one the writer could not have produced after the items so far.
Sourcepub fn from_items(
items: Vec<Item<StreamEvent>>,
) -> Result<Transcript, SequenceError>
pub fn from_items( items: Vec<Item<StreamEvent>>, ) -> Result<Transcript, SequenceError>
Items a stream yielded, checked as Self::push checks them: a
stream that stopped early may leave parts open.
Sourcepub fn items(&self) -> &[Item<StreamEvent>]
pub fn items(&self) -> &[Item<StreamEvent>]
The items, in order.
Sourcepub fn into_items(self) -> Vec<Item<StreamEvent>>
pub fn into_items(self) -> Vec<Item<StreamEvent>>
The items, in order.
Sourcepub fn events(&self) -> impl Iterator<Item = &StreamEvent>
pub fn events(&self) -> impl Iterator<Item = &StreamEvent>
The events, in order, without the unmodeled payloads.
Trait Implementations§
Source§impl Clone for Transcript
impl Clone for Transcript
Source§fn clone(&self) -> Transcript
fn clone(&self) -> Transcript
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more