[][src]Struct spectrusty_formats::tap::TapChunkWriter

pub struct TapChunkWriter<W> { /* fields omitted */ }

A tool for writing TAP file chunks to byte streams.

Data can be written in one of 3 ways:

Implementations

impl<W> TapChunkWriter<W>[src]

pub fn into_inner(self) -> PulseDecodeWriter<W>[src]

Returns the underlying pulse decode writer.

pub fn get_mut(&mut self) -> &mut PulseDecodeWriter<W>[src]

Returns a mutable reference to the inner pulse decode writer.

pub fn get_ref(&self) -> &PulseDecodeWriter<W>[src]

Returns a shared reference to the inner pulse decode writer.

impl<W> TapChunkWriter<W> where
    W: Write + Seek
[src]

pub fn try_new(wr: W) -> Result<Self>[src]

Returns a new instance of TapChunkWriter with the given writer on success.

The stream cursor should be positioned where the next chunk will be written.

This method does not write any data, but moves the stream cursor to make room for the next block's length indicator.

pub fn flush(&mut self) -> Result<()>[src]

Flushes the underlying writer, ensuring that all intermediately buffered contents reach their destination (invokes Write::flush).

pub fn end_pulse_chunk(&mut self) -> Result<usize>[src]

Forces pending pulse decode data transfer to end.

Returns the number of TAP chunks written.

pub fn write_header(&mut self, header: &Header) -> Result<usize>[src]

Writes a provided header as a TAP chunk.

Flushes internal mic pulse writer before proceeding with writing the header.

Returns the number of TAP chunks written.

pub fn write_chunk<D: AsRef<[u8]>>(&mut self, chunk: D) -> Result<usize>[src]

Writes provided data as a TAP chunk.

Flushes internal mic pulse writer before proceeding with writing the data.

Returns the number of TAP chunks written.

pub fn begin(&mut self) -> Result<TapChunkWriteTran<'_, W>>[src]

Creates a transaction allowing for multiple data writes to the same TAP chunk.

Flushes internal mic pulse writer.

Returns a transaction holder, which can be used to write data to the current chunk.

pub fn write_pulses_as_tap_chunks<I>(&mut self, mut iter: I) -> Result<usize> where
    I: Iterator<Item = NonZeroU32>, 
[src]

Interprets pulse intervals from the provided iterator as bytes and writes them to the underlying writer as TAP chunks.

See PulseDecodeWriter.

Returns the number of TAP chunks written.

Auto Trait Implementations

impl<W> RefUnwindSafe for TapChunkWriter<W> where
    W: RefUnwindSafe
[src]

impl<W> Send for TapChunkWriter<W> where
    W: Send
[src]

impl<W> Sync for TapChunkWriter<W> where
    W: Sync
[src]

impl<W> Unpin for TapChunkWriter<W> where
    W: Unpin
[src]

impl<W> UnwindSafe for TapChunkWriter<W> where
    W: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S, T> IntoSample<S> for T where
    S: FromSample<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,