pub struct RecordingSession<W: Write + Send> { /* private fields */ }Expand description
Live-Recording-Session.
Thread-safe: mehrere Threads koennen gleichzeitig
record_sample callen.
Implementations§
Source§impl<W: Write + Send> RecordingSession<W>
impl<W: Write + Send> RecordingSession<W>
Sourcepub fn new(sink: W, opts: SessionOptions) -> Self
pub fn new(sink: W, opts: SessionOptions) -> Self
Erzeugt eine neue Session ueber sink. Der Header wird beim
ersten record_sample geschrieben.
Sourcepub fn record_sample(
&self,
now_unix_ns: i64,
participant_guid: [u8; 16],
topic: &TopicKey,
sample_kind: SampleKind,
payload: Vec<u8>,
) -> Result<(), SessionError>
pub fn record_sample( &self, now_unix_ns: i64, participant_guid: [u8; 16], topic: &TopicKey, sample_kind: SampleKind, payload: Vec<u8>, ) -> Result<(), SessionError>
Schreibt einen Sample. now_unix_ns muss die aktuelle
Wallclock-Zeit in Nanosekunden seit Epoch sein.
§Errors
Siehe SessionError.
Sourcepub fn stats(&self) -> SessionStats
pub fn stats(&self) -> SessionStats
Liefert die aktuellen Counter (Snapshot).
Auto Trait Implementations§
impl<W> !Freeze for RecordingSession<W>
impl<W> RefUnwindSafe for RecordingSession<W>
impl<W> Send for RecordingSession<W>
impl<W> Sync for RecordingSession<W>
impl<W> Unpin for RecordingSession<W>where
W: Unpin,
impl<W> UnsafeUnpin for RecordingSession<W>where
W: UnsafeUnpin,
impl<W> UnwindSafe for RecordingSession<W>
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