[−][src]Enum spectrusty_utils::tap::Tap
An enum with two variants, one for reading and the other for writing to the same TAP file.
Variants
Implementations
impl<F: Write + Read + Seek> Tap<F>[src]
pub fn new_reader(file: F) -> Self[src]
Returns a Tap::Reader variant.
pub fn try_new_writer(file: F) -> Result<Self>[src]
Returns a Tap::Writer variant on success.
pub fn reader_mut(&mut self) -> Option<&mut TapChunkPulseIter<F>>[src]
Returns a mutable reference to the pulse iterator if the current variant of self is Tap::Reader.
pub fn writer_mut(&mut self) -> Option<&mut TapChunkWriter<F>>[src]
Returns a mutable reference to the tap chunk writer if the current variant of self is Tap::Writer.
pub fn reader_ref(&self) -> Option<&TapChunkPulseIter<F>>[src]
Returns a reference to the pulse iterator if the current variant of self is Tap::Reader.
pub fn writer_ref(&self) -> Option<&TapChunkWriter<F>>[src]
Returns a reference to the tap chunk writer if the current variant of self is Tap::Writer.
pub fn is_reader(&self) -> bool[src]
Returns true if self is a Tap::Reader.
pub fn is_writer(&self) -> bool[src]
Returns true if self is a Tap::Writer.
pub fn try_into_reader(self) -> Result<Self>[src]
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.
pub fn try_into_writer(self) -> Result<Self>[src]
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.
pub fn try_into_file(self) -> Result<F>[src]
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.
pub fn try_reader_mut(&mut self) -> Result<TapChunkReaderMut<'_, F>>[src]
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.
pub fn rewind(&mut self) -> bool[src]
Conditionally rewinds a tape if its variant is Tap::Reader. In this instance returns true.
Otherwise returns false.
pub fn forward_chunk(&mut self) -> Result<Option<bool>>[src]
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).
pub fn rewind_prev_chunk(&mut self) -> Result<Option<u32>>[src]
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).
pub fn rewind_chunk(&mut self) -> Result<Option<u32>>[src]
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).
pub fn rewind_nth_chunk(&mut self, chunk_no: u32) -> Result<Option<bool>>[src]
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> !RefUnwindSafe for Tap<F>
impl<F> Send for Tap<F> where
F: Send,
F: Send,
impl<F> Sync for Tap<F> where
F: Sync,
F: Sync,
impl<F> Unpin for Tap<F> where
F: Unpin,
F: Unpin,
impl<F> !UnwindSafe for Tap<F>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> Downcast for T where
T: Any,
T: Any,
fn into_any(self: Box<T>) -> Box<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<S, T> IntoSample<S> for T where
S: FromSample<T>,
S: FromSample<T>,
fn into_sample(self) -> S
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,