Trait InputBlockIterator

Source
pub trait InputBlockIterator<'i, const N: usize> {
    type Block: InputBlock<'i, N>;
    type Error: Into<InputError>;

    // Required methods
    fn next(&mut self) -> Result<Option<Self::Block>, Self::Error>;
    fn get_offset(&self) -> usize;
    fn offset(&mut self, count: isize);
}
Expand description

An iterator over blocks of input of size N. Implementations MUST guarantee that the blocks returned from next are exactly of size N.

Required Associated Types§

Source

type Block: InputBlock<'i, N>

The type of blocks returned.

Source

type Error: Into<InputError>

Type of errors that can occur when reading from this iterator.

Required Methods§

Source

fn next(&mut self) -> Result<Option<Self::Block>, Self::Error>

Advances the iterator and returns the next value.

§Errors

May fail depending on the implementation.

Source

fn get_offset(&self) -> usize

Get the offset of the iterator in the input.

The offset is the starting point of the block that will be returned next from this iterator, if any. It starts as 0 and increases by N on every block retrieved.

Source

fn offset(&mut self, count: isize)

Offset the iterator by count full blocks forward.

The count parameter must be greater than 0.

Implementors§

Source§

impl<'a, 'r, R, const N: usize> InputBlockIterator<'a, N> for BorrowedBytesBlockIterator<'r, EndPaddedInput<'a>, R, N>
where R: InputRecorder<&'a [u8]> + 'r,

Source§

impl<'a, 'r, R, const N: usize> InputBlockIterator<'a, N> for BorrowedBytesBlockIterator<'r, TwoSidesPaddedInput<'a>, R, N>
where R: InputRecorder<&'a [u8]> + 'r,

Source§

impl<'a, R: Read, IR, const N: usize> InputBlockIterator<'a, N> for BufferedInputBlockIterator<'a, '_, R, IR, N>