DelimReader
Mojo struct 🡭
DelimReader
@memory_only
struct DelimReader[RowType: FromDelimited]
Read delimited data that is delimited by a single bytes.
The RowType
must implement FromBytes
which is passed an iterator over the split up line.
Parameters
- RowType (
FromDelimited
)
Fields
- delim (
SIMD[uint8, 1]
) - reader (
BufferedReader
) - next_elem (
Optional[RowType]
) - buffer (
List[SIMD[uint8, 1]]
) - len (
Int
) - has_header (
Bool
) - header_values (
Optional[List[String]]
)
Implemented traits
AnyType
, Movable
, UnknownDestructibility
Methods
➕ ➖__init__
fn __init__(out self, var reader: BufferedReader, *, delim: SIMD[uint8, 1], has_header: Bool)
Details
Args:
- reader (
BufferedReader
) - delim (
SIMD
) - has_header (
Bool
) - self (
Self
)
Returns:
Self
Raises:
__moveinit__
@staticmethod
fn __moveinit__(out self, var existing: Self)
Details
Args:
- existing (
Self
) - self (
Self
)
Returns:
Self
__len__
fn __len__(self) -> Int
Details
Args:
- self (
Self
)
Returns:
Int
__has_next__
fn __has_next__(self) -> Bool
Details
Args:
- self (
Self
)
Returns:
Bool
__next__
fn __next__(mut self) -> RowType
Details
Args:
- self (
Self
)
Returns:
RowType
Raises:
__iter__
fn __iter__(var self) -> Self
Details
Args:
- self (
Self
)
Returns:
Self