I want a character one at a time from BytesMut object. For this purpose, I used the get_u8() from the bytes::Buf trait.
Since, BytesMut implements bytes::Buf, I was hoping that I could directly call get_u8 on BytesMut object without having to import use bytes::Buf trait in the file where I am calling get_u8() on the BytesMut object.
The error that I get is:
no method named `get_u8` found for struct `BytesMut` in the current scope
items from traits can only be used if the trait is in scope.
I get the error and am aware that I have to import the trait in the current file with use bytes::Buf. What I am not sure about is the rationale behind this implementation.