pub struct Record { /* private fields */ }
Expand description
A record is a timestamped piece of data with labels
Implementations§
Source§impl Record
impl Record
pub fn builder() -> RecordBuilder
Sourcepub fn timestamp_us(&self) -> u64
pub fn timestamp_us(&self) -> u64
Unix timestamp in microseconds
Sourcepub fn timestamp(&self) -> SystemTime
pub fn timestamp(&self) -> SystemTime
Timestamp as a SystemTime
Sourcepub fn content_type(&self) -> &str
pub fn content_type(&self) -> &str
Content type of the record
Sourcepub fn content_length(&self) -> usize
pub fn content_length(&self) -> usize
Content length of the record
Sourcepub fn bytes(
self,
) -> Pin<Box<dyn Future<Output = Result<Bytes, ReductError>> + Send + Sync>>
pub fn bytes( self, ) -> Pin<Box<dyn Future<Output = Result<Bytes, ReductError>> + Send + Sync>>
Content of the record
This consumes the record and returns bytes
Sourcepub fn stream_bytes(
self,
) -> Pin<Box<dyn Stream<Item = Result<Bytes, ReductError>> + Sync + Send>>
pub fn stream_bytes( self, ) -> Pin<Box<dyn Stream<Item = Result<Bytes, ReductError>> + Sync + Send>>
Content of the record as a stream
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Record
impl !RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl !UnwindSafe for Record
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