Struct AddressBasedReader

Source
pub struct AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: AddressSpace<T>,
{ /* private fields */ }
Expand description

A Reader implementation that’s based on an AddressSpace of the read items.

Implementations§

Source§

impl<T, AddressSpaceType> AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: AddressSpace<T>,

Source

pub fn raw_new(address_space: AddressSpaceType) -> Self

Create a new reader over the items in the given address space.

Source§

impl AddressBasedReader<u8, ByteArrayAddressSpace>

Source

pub fn from_string(data: String) -> ByteArrayReader

Creates a new Reader for accessing the sequence of bytes in a given String.

Source

pub fn from_string_slice(data: &str) -> Self

Creates a new Reader for accessing the sequence of bytes in a string, copied from the given string-slice.

Trait Implementations§

Source§

impl<T, AddressSpaceType> Reader<T> for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: AddressSpace<T>,

Source§

fn read_next(&mut self) -> Option<T>

Reads the item pointed by cursor, and advance cursor to the next item. Read more
Source§

fn set_head(&mut self)

Set head to point to the item pointed by cursor.
Source§

fn set_tail(&mut self)

Set tail to point to the item pointed by cursor.
Source§

fn move_cursor_to_tail(&mut self)

Set cursor to point to the item pointed by tail.
Source§

fn get_sequence(&self) -> impl Iterator<Item = T>

Get an iterator over all items between head (inclusive) and tail (exclusive).
Source§

fn restart_from_tail(&mut self)

Set cursor and head to point to the item pointed by tail.

Auto Trait Implementations§

§

impl<T, AddressSpaceType> Freeze for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: Freeze,

§

impl<T, AddressSpaceType> RefUnwindSafe for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: RefUnwindSafe, T: RefUnwindSafe,

§

impl<T, AddressSpaceType> Send for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: Send, T: Send,

§

impl<T, AddressSpaceType> Sync for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: Sync, T: Sync,

§

impl<T, AddressSpaceType> Unpin for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: Unpin, T: Unpin,

§

impl<T, AddressSpaceType> UnwindSafe for AddressBasedReader<T, AddressSpaceType>
where AddressSpaceType: UnwindSafe, T: UnwindSafe,

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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.