struct OneByteReader
pub struct OneByteReader {
pub data string
pub off int
}Purpose
Iotest Streaming reader and decoder.
Public fields
datastring- data
offint- offset
#testing/iotestOne-byte / half-size readers, plus err_reader that always throws.
struct OneByteReaderpub struct OneByteReader {
pub data string
pub off int
}Iotest Streaming reader and decoder.
data stringoff intone_byte_readerpub fn one_byte_reader(s string) OneByteReaderOne byte reader.
s stringOneByteReader — a value of this type
($&OneByteReader) read_npub fn (r $&OneByteReader) read_n(n int) stringOperation on $&OneByteReader: read at most n bytes; may return shorter or empty at end.
r $&OneByteReaderOneByteReader instance used by this call (exclusive borrow).n intstring — result string
struct HalfReaderpub struct HalfReader {
pub data string
pub off int
}Iotest Streaming reader and decoder.
data stringoff inthalf_readerpub fn half_reader(s string) HalfReaderHalf reader.
s stringHalfReader — a value of this type
($&HalfReader) read_npub fn (r $&HalfReader) read_n(n int) stringOperation on $&HalfReader: read at most n bytes; may return shorter or empty at end.
r $&HalfReaderHalfReader instance used by this call (exclusive borrow).n intstring — result string
struct ErrReaderpub struct ErrReader {
pub msg string
}Iotest Streaming reader and decoder.
msg stringerr_readerpub fn err_reader(msg string) ErrReaderErr reader.
msg stringErrReader — a value of this type
(ErrReader) read_npub fn (r ErrReader) read_n(n int) stringOperation on ErrReader: read at most n bytes; may return shorter or empty at end. Throws on failure; handle the error or propagate it to the caller.
r ErrReaderErrReader instance used by this call (value receiver).n intstring — result string