pub struct Reader<S: RecvStream, V> { /* private fields */ }Implementations§
Source§impl<S: RecvStream, V> Reader<S, V>
impl<S: RecvStream, V> Reader<S, V>
pub fn new(stream: S, version: V) -> Self
pub async fn decode<T: Decode<V> + Debug>(&mut self) -> Result<T, Error>where
V: Clone,
pub async fn decode_maybe<T: Decode<V> + Debug>(
&mut self,
) -> Result<Option<T>, Error>where
V: Clone,
pub async fn decode_peek<T: Decode<V> + Debug>(&mut self) -> Result<T, Error>where
V: Clone,
pub async fn read(&mut self, max: usize) -> Result<Option<Bytes>, Error>
pub async fn read_exact(&mut self, size: usize) -> Result<Bytes, Error>
pub async fn skip(&mut self, size: usize) -> Result<(), Error>
Sourcepub async fn closed(&mut self) -> Result<(), Error>
pub async fn closed(&mut self) -> Result<(), Error>
Wait until the stream is closed, erroring if there are any additional bytes.
pub fn abort(&mut self, err: &Error)
pub fn with_version<O>(self, version: O) -> Reader<S, O>
Auto Trait Implementations§
impl<S, V> Freeze for Reader<S, V>
impl<S, V> RefUnwindSafe for Reader<S, V>where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V> Send for Reader<S, V>where
V: Send,
impl<S, V> Sync for Reader<S, V>
impl<S, V> Unpin for Reader<S, V>
impl<S, V> UnwindSafe for Reader<S, V>where
S: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more