pub struct StreamData {
pub stream_id: String,
pub source: Option<String>,
pub samples: SampleTable,
}Fields§
§stream_id: StringUnique identifier for this stream.
source: Option<String>Origin of this stream data, used for attribution in metrics.
This remains optional for wire compatibility. When absent, ingress
rollups are still tracked under an explicit "unknown" source.
samples: SampleTableThe actual data being streamed.
Methods from Deref<Target = SampleTable>§
Sourcepub fn iter_rows<'values>(
&'values self,
) -> Result<impl Iterator<Item = RowRef<'values>>, SampleTableError>
pub fn iter_rows<'values>( &'values self, ) -> Result<impl Iterator<Item = RowRef<'values>>, SampleTableError>
Lazily-evaluated iterator over the rows of the sample table.
Sourcepub fn channels(&self) -> &[ChannelStreamDescriptor]
pub fn channels(&self) -> &[ChannelStreamDescriptor]
The channels in the sample table.
Sourcepub fn timestamps(&self) -> &[u64]
pub fn timestamps(&self) -> &[u64]
The timestamps in the sample table.
Sourcepub fn columns(&self) -> &[ValueSeries]
pub fn columns(&self) -> &[ValueSeries]
The columns in the sample table.
Sourcepub fn get_channel_values(
&self,
channel: &ChannelStreamDescriptor,
) -> Option<&ValueSeries>
pub fn get_channel_values( &self, channel: &ChannelStreamDescriptor, ) -> Option<&ValueSeries>
The values for a given channel.
Sourcepub fn get_timestamped_channel_values(
&self,
channel: &ChannelStreamDescriptor,
) -> Option<impl Iterator<Item = (u64, ValueRef<'_>)>>
pub fn get_timestamped_channel_values( &self, channel: &ChannelStreamDescriptor, ) -> Option<impl Iterator<Item = (u64, ValueRef<'_>)>>
The values for a given channel and timestamp.
Sourcepub fn num_points(&self) -> usize
pub fn num_points(&self) -> usize
The number of points in the stream.
Sourcepub fn scale_channel(
&mut self,
channel: &ChannelStreamDescriptor,
f: impl FnMut(ValueRef<'_>) -> Result<f64, String>,
) -> Result<(), SampleTableError>
pub fn scale_channel( &mut self, channel: &ChannelStreamDescriptor, f: impl FnMut(ValueRef<'_>) -> Result<f64, String>, ) -> Result<(), SampleTableError>
Apply a scaling function to a channel’s values in place.
An error is returned if the channel specified is not present.
If any individual scaling operation fails, no further values are computed and the error is returned.
Trait Implementations§
Source§impl Clone for StreamData
impl Clone for StreamData
Source§fn clone(&self) -> StreamData
fn clone(&self) -> StreamData
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 StreamData
impl Debug for StreamData
Source§impl Deref for StreamData
impl Deref for StreamData
Source§impl DerefMut for StreamData
impl DerefMut for StreamData
Source§impl<'de> Deserialize<'de> for StreamData
impl<'de> Deserialize<'de> for StreamData
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for StreamData
impl RefUnwindSafe for StreamData
impl Send for StreamData
impl Sync for StreamData
impl Unpin for StreamData
impl UnsafeUnpin for StreamData
impl UnwindSafe for StreamData
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