read_all exists for Vec to read as long as there is remaining data, it would be nice if you could do something similar for Option, but reading up to one item (instead erroring if there is leftover data?). I'm aware you can assert the Vec length, but the ergonomics are not great.
Using the name read_all for Option isn't a great fit, perhaps read_opt?
read_allexists forVecto read as long as there is remaining data, it would be nice if you could do something similar forOption, but reading up to one item (instead erroring if there is leftover data?). I'm aware you can assert theVeclength, but the ergonomics are not great.Using the name
read_allforOptionisn't a great fit, perhapsread_opt?