watermelon-proto 0.1.8

#[no_std] NATS Core Sans-IO protocol implementation
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use bytes::{Buf, Bytes};

pub(crate) trait ToBytes: Buf {
    fn to_bytes(mut self) -> Bytes
    where
        Self: Sized,
    {
        self.copy_to_bytes(self.remaining())
    }
}

impl<T: Buf> ToBytes for T {}