How do I read an integer from a buffer in Rust 1.0?

The API for reading scalar values โ€‹โ€‹seems to have been removed from traits Cursor

and Reader

io. Is there a standard library replacement for these or do I need to write my own?

For example, it was possible to write:

let magic = try!(reader.read_be_u16());



source to share

1 answer

This functionality is no longer included in the standard library, but there are other libraries. byteorder is popular.



All Articles