pub struct StreamRecord { /* 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 StreamRecord
impl StreamRecord
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 StreamRecord
impl Clone for StreamRecord
Source§impl Debug for StreamRecord
impl Debug for StreamRecord
Source§impl Default for StreamRecord
impl Default for StreamRecord
Source§impl<'de> Deserialize<'de> for StreamRecord
Read as the item list it is, with no Value tree between.
impl<'de> Deserialize<'de> for StreamRecord
Read as the item list it is, with no Value tree between.
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<StreamRecord> for Vec<Item<StreamEvent>>
impl From<StreamRecord> for Vec<Item<StreamEvent>>
Source§fn from(transcript: StreamRecord) -> Self
fn from(transcript: StreamRecord) -> Self
Source§impl PartialEq for StreamRecord
impl PartialEq for StreamRecord
Auto Trait Implementations§
impl Freeze for StreamRecord
impl RefUnwindSafe for StreamRecord
impl Send for StreamRecord
impl Sync for StreamRecord
impl Unpin for StreamRecord
impl UnsafeUnpin for StreamRecord
impl UnwindSafe for StreamRecord
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