pub struct StreamItem { /* private fields */ }Expand description
One unit of flow through the spine: a packet plus its clock-domain ticks.
Couples a StreamPacket payload with the Ticks observed at it, so a
packet carries its clock-domain context as it moves through the stream. An
item can be projected into a runtime Value, a SequenceItem, or a
sequenced packet Event.
Implementations§
Source§impl StreamItem
impl StreamItem
Sourcepub fn new(packet: StreamPacket) -> Self
pub fn new(packet: StreamPacket) -> Self
Creates an item carrying packet with no ticks.
Sourcepub fn with_ticks(packet: StreamPacket, ticks: Vec<Tick>) -> Result<Self>
pub fn with_ticks(packet: StreamPacket, ticks: Vec<Tick>) -> Result<Self>
Creates an item carrying packet with ticks, validating the ticks.
Returns an error if ticks is not a valid clock-domain reading.
Sourcepub fn packet(&self) -> &StreamPacket
pub fn packet(&self) -> &StreamPacket
Returns the packet payload.
Sourcepub fn packet_value(&self, cx: &mut Cx) -> Result<Value>
pub fn packet_value(&self, cx: &mut Cx) -> Result<Value>
Materializes the packet payload as a runtime Value.
Sourcepub fn sequence_item(&self, cx: &mut Cx) -> Result<SequenceItem>
pub fn sequence_item(&self, cx: &mut Cx) -> Result<SequenceItem>
Projects this item into a SequenceItem, preserving its ticks.
Trait Implementations§
Source§impl Clone for StreamItem
impl Clone for StreamItem
Source§fn clone(&self) -> StreamItem
fn clone(&self) -> StreamItem
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StreamItem
impl Debug for StreamItem
impl Eq for StreamItem
Source§impl PartialEq for StreamItem
impl PartialEq for StreamItem
Source§fn eq(&self, other: &StreamItem) -> bool
fn eq(&self, other: &StreamItem) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for StreamItem
Auto Trait Implementations§
impl Freeze for StreamItem
impl RefUnwindSafe for StreamItem
impl Send for StreamItem
impl Sync for StreamItem
impl Unpin for StreamItem
impl UnsafeUnpin for StreamItem
impl UnwindSafe for StreamItem
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
Mutably borrows from an owned value. Read more