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<Self, SequenceError>
pub fn parse(value: Value) -> Result<Self, 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<Self, SequenceError>
pub fn parse_prefix(value: Value) -> Result<Self, 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<Self, SequenceError>
pub fn from_items(items: Vec<Item<StreamEvent>>) -> Result<Self, 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§impl Debug for Transcript
impl Debug for Transcript
Source§impl Default for Transcript
impl Default for Transcript
Source§impl<'de> Deserialize<'de> for Transcript
impl<'de> Deserialize<'de> for Transcript
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Source§impl From<Transcript> for Vec<Item<StreamEvent>>
impl From<Transcript> for Vec<Item<StreamEvent>>
Source§fn from(transcript: Transcript) -> Self
fn from(transcript: Transcript) -> Self
Source§impl PartialEq for Transcript
impl PartialEq for Transcript
Auto Trait Implementations§
impl Freeze for Transcript
impl RefUnwindSafe for Transcript
impl Send for Transcript
impl Sync for Transcript
impl Unpin for Transcript
impl UnsafeUnpin for Transcript
impl UnwindSafe for Transcript
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more