Skip to main content

AsyncWriter

Struct AsyncWriter 

Source
pub struct AsyncWriter<'a, S: AsyncSink> { /* private fields */ }
Available on crate feature async only.
Expand description

Writes the messages of one file to an async sink, as Writer does to a sink. write_async hands one to the source, and AsyncOnePass::writer gives one, so a function taking a &mut AsyncWriter serves both.

A call returns once its bytes are staged and each stage they filled has gone to the sink, so the sink’s error can surface as Error::Sink on a later call; write_async and AsyncOnePass::finish return it.

Implementations§

Source§

impl<S: AsyncSink> AsyncWriter<'_, S>

Source

pub async fn start( &mut self, t: Timestamp, creator: &Device<'_>, ) -> Result<(), Error>

Writer::start, awaiting the sink.

§Errors

As Writer::start.

Source

pub async fn device(&mut self, device: &Device<'_>) -> Result<(), Error>

Writer::device, awaiting the sink.

§Errors

As Writer::device.

Source

pub async fn session( &mut self, t: Timestamp, sport: Sport, sub_sport: SubSport, ) -> Result<(), Error>

Writer::session, awaiting the sink.

§Errors

As Writer::session.

Source

pub async fn pool_swim(&mut self, t: Timestamp, pool: Pool) -> Result<(), Error>

Writer::pool_swim, awaiting the sink.

§Errors

As Writer::pool_swim.

Source

pub async fn leg(&mut self, t: Timestamp, leg: &Leg<'_>) -> Result<(), Error>

Writer::leg, awaiting the sink.

§Errors

As Writer::leg.

Source

pub async fn record(&mut self, record: &Record) -> Result<(), Error>

Writer::record, awaiting the sink.

§Errors

As Writer::record.

Source

pub async fn record_with( &mut self, record: &Record, extras: &[Extra<'_>], ) -> Result<(), Error>

Writer::record_with, awaiting the sink.

§Errors

As Writer::record_with.

Source

pub async fn lap(&mut self, t: Timestamp) -> Result<(), Error>

Writer::lap, awaiting the sink.

§Errors

As Writer::lap.

Source

pub async fn lap_by( &mut self, t: Timestamp, trigger: LapTrigger, ) -> Result<(), Error>

Writer::lap_by, awaiting the sink.

§Errors

As Writer::lap_by.

Source

pub async fn pause(&mut self, t: Timestamp) -> Result<(), Error>

Writer::pause, awaiting the sink.

§Errors

As Writer::pause.

Source

pub async fn resume(&mut self, t: Timestamp) -> Result<(), Error>

Writer::resume, awaiting the sink.

§Errors

As Writer::resume.

Source

pub async fn length( &mut self, t: Timestamp, length: &Length, ) -> Result<(), Error>

Writer::length, awaiting the sink.

§Errors

As Writer::length.

Source

pub async fn set(&mut self, t: Timestamp, set: &Set) -> Result<(), Error>

Writer::set, awaiting the sink.

§Errors

As Writer::set.

Source

pub async fn rest(&mut self, t: Timestamp) -> Result<(), Error>

Writer::rest, awaiting the sink.

§Errors

As Writer::rest.

Source

pub async fn end_rest(&mut self, t: Timestamp) -> Result<(), Error>

Writer::end_rest, awaiting the sink.

§Errors

As Writer::end_rest.

Source

pub async fn developer(&mut self, developer: &Developer) -> Result<Dev, Error>

Writer::developer, awaiting the sink.

§Errors

As Writer::developer.

Source

pub async fn declare<T: DevType + ?Sized, K: Kind>( &mut self, description: &FieldDescription<'_, T, K>, ) -> Result<DevField<T, K>, Error>

Writer::declare, awaiting the sink.

§Errors

As Writer::declare.

Source

pub async fn developer_value<T: DevType + ?Sized, K: Summary>( &mut self, field: &DevField<T, K>, value: T::Value<'_>, ) -> Result<(), Error>

Writer::developer_value, awaiting the sink.

§Errors

As Writer::developer_value.

Source

pub async fn raw_message( &mut self, global: u16, fields: &[RawField<'_>], ) -> Result<(), Error>

Writer::raw_message, awaiting the sink.

§Errors

As Writer::raw_message.

Source

pub async fn end(&mut self, t: Timestamp) -> Result<(), Error>

Writer::end, awaiting the sink.

§Errors

As Writer::end.

Source

pub async fn beat_intervals_ms( &mut self, intervals: &[u16], ) -> Result<(), Error>

Source

pub async fn beat_intervals_1024ths( &mut self, intervals: &[u16], ) -> Result<(), Error>

Trait Implementations§

Source§

impl<S: AsyncSink> Debug for AsyncWriter<'_, S>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, S> !UnwindSafe for AsyncWriter<'a, S>

§

impl<'a, S> Forget for AsyncWriter<'a, S>

§

impl<'a, S> Freeze for AsyncWriter<'a, S>
where &'a mut State: Freeze, &'a mut Staged<S>: Freeze,

§

impl<'a, S> Move for AsyncWriter<'a, S>

§

impl<'a, S> RefUnwindSafe for AsyncWriter<'a, S>

§

impl<'a, S> Send for AsyncWriter<'a, S>
where S: Send, &'static [FieldDef]: Send, <S as AsyncSink>::Error: Send,

§

impl<'a, S> Sync for AsyncWriter<'a, S>
where S: Sync, <S as AsyncSink>::Error: Sync,

§

impl<'a, S> Unpin for AsyncWriter<'a, S>
where &'a mut State: Unpin, &'a mut Staged<S>: Unpin,

§

impl<'a, S> UnsafeUnpin for AsyncWriter<'a, S>
where &'a mut State: UnsafeUnpin, &'a mut Staged<S>: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.