mirror of
https://github.com/tokio-rs/bytes.git
synced 2026-08-20 00:00:10 +02:00
@@ -1120,6 +1120,10 @@ pub trait Buf {
|
|||||||
/// let bytes = (&b"hello world"[..]).copy_to_bytes(5);
|
/// let bytes = (&b"hello world"[..]).copy_to_bytes(5);
|
||||||
/// assert_eq!(&bytes[..], &b"hello"[..]);
|
/// assert_eq!(&bytes[..], &b"hello"[..]);
|
||||||
/// ```
|
/// ```
|
||||||
|
///
|
||||||
|
/// # Panics
|
||||||
|
///
|
||||||
|
/// This function panics if `len > self.remaining()`.
|
||||||
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
|
fn copy_to_bytes(&mut self, len: usize) -> crate::Bytes {
|
||||||
use super::BufMut;
|
use super::BufMut;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user