pub enum Tap<F> {
Reader(TapChunkPulseIter<F>),
Writer(TapChunkWriter<F>),
}Expand description
Variants§
Reader(TapChunkPulseIter<F>)
Writer(TapChunkWriter<F>)
Implementations§
Source§impl<F: Write + Read + Seek> Tap<F>
impl<F: Write + Read + Seek> Tap<F>
Sourcepub fn new_reader(file: F) -> Self
pub fn new_reader(file: F) -> Self
Returns a Tap::Reader variant.
Sourcepub fn try_new_writer(file: F) -> Result<Self>
pub fn try_new_writer(file: F) -> Result<Self>
Returns a Tap::Writer variant on success.
Sourcepub fn reader_mut(&mut self) -> Option<&mut TapChunkPulseIter<F>>
pub fn reader_mut(&mut self) -> Option<&mut TapChunkPulseIter<F>>
Returns a mutable reference to the pulse iterator if the current variant of self is Tap::Reader.
Sourcepub fn writer_mut(&mut self) -> Option<&mut TapChunkWriter<F>>
pub fn writer_mut(&mut self) -> Option<&mut TapChunkWriter<F>>
Returns a mutable reference to the tap chunk writer if the current variant of self is Tap::Writer.
Sourcepub fn reader_ref(&self) -> Option<&TapChunkPulseIter<F>>
pub fn reader_ref(&self) -> Option<&TapChunkPulseIter<F>>
Returns a reference to the pulse iterator if the current variant of self is Tap::Reader.
Sourcepub fn writer_ref(&self) -> Option<&TapChunkWriter<F>>
pub fn writer_ref(&self) -> Option<&TapChunkWriter<F>>
Returns a reference to the tap chunk writer if the current variant of self is Tap::Writer.
Sourcepub fn is_reader(&self) -> bool
pub fn is_reader(&self) -> bool
Returns true if self is a Tap::Reader.
Sourcepub fn is_writer(&self) -> bool
pub fn is_writer(&self) -> bool
Returns true if self is a Tap::Writer.
Sourcepub fn try_into_reader(self) -> Result<Self>
pub fn try_into_reader(self) -> Result<Self>
Transforms the provided Tap into the Tap::Reader on success.
The cursor position of the reader is set to the beginning of a file.
If self is a Tap::Writer this method ensures that the chunk being currently written is
comitted thus ensuring the integrity of the TAP file and also calls the Write::flush on
the file before transforming it.
Sourcepub fn try_into_writer(self) -> Result<Self>
pub fn try_into_writer(self) -> Result<Self>
Transforms the provided Tap into the Tap::Writer on success.
The cursor position of the writer is set to the end of a file.
If self is already a Tap::Writer this method ensures that the chunk being currently written
is comitted thus ensuring the integrity of the TAP file and also calls the Write::flush on
the file before transforming it.
Sourcepub fn try_into_file(self) -> Result<F>
pub fn try_into_file(self) -> Result<F>
Returns the unwrapped file on success.
If self is a Tap::Writer this method ensures that the chunk being currently written is
comitted thus ensuring the integrity of the TAP file and also calls the Write::flush on
the file before returning it.
Sourcepub fn try_reader_mut(&mut self) -> Result<TapChunkReaderMut<'_, F>>
pub fn try_reader_mut(&mut self) -> Result<TapChunkReaderMut<'_, F>>
Returns a clone of TapChunkReader with a mutable reference to the file under the guard that ensures the position of the underlying file is set back to where it was before this method was called when the guard goes out of scope.
Sourcepub fn rewind(&mut self) -> bool
pub fn rewind(&mut self) -> bool
Conditionally rewinds a tape if its variant is Tap::Reader. In this instance returns true.
Otherwise returns false.
Sourcepub fn forward_chunk(&mut self) -> Result<Option<bool>>
pub fn forward_chunk(&mut self) -> Result<Option<bool>>
Conditionally forwards a tape to the next chunk if its variant is Tap::Reader. In this
instance returns Ok(Some(was_next_chunk)). Otherwise returns Ok(None).
Sourcepub fn rewind_prev_chunk(&mut self) -> Result<Option<u32>>
pub fn rewind_prev_chunk(&mut self) -> Result<Option<u32>>
Conditionally rewinds a tape to the previous chunk if its variant is Tap::Reader. In this
instance returns Ok(Some(chunk_no)). Otherwise returns Ok(None).
Sourcepub fn rewind_chunk(&mut self) -> Result<Option<u32>>
pub fn rewind_chunk(&mut self) -> Result<Option<u32>>
Conditionally rewinds a tape to the beginning of the current chunk if its variant is
Tap::Reader. In this instance returns Ok(Some(chunk_no)). Otherwise returns Ok(None).
Sourcepub fn rewind_nth_chunk(&mut self, chunk_no: u32) -> Result<Option<bool>>
pub fn rewind_nth_chunk(&mut self, chunk_no: u32) -> Result<Option<bool>>
Conditionally rewinds or forwards a tape to the nth chunk if its variant is Tap::Reader.
In this instance returns Ok(Some(was_a_chunk)). Otherwise returns Ok(None).
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Tap<F>where
F: Freeze,
impl<F> !RefUnwindSafe for Tap<F>
impl<F> Send for Tap<F>where
F: Send,
impl<F> Sync for Tap<F>where
F: Sync,
impl<F> Unpin for Tap<F>where
F: Unpin,
impl<F> !UnwindSafe for Tap<F>
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
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
impl<S, T> IntoSample<S> for Twhere
S: FromSample<T>,
Source§fn into_sample(self) -> S
fn into_sample(self) -> S
S a sample type from self.Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.