Struct tokio_util::codec::BytesCodec [−][src]
A simple Decoder and Encoder implementation that just ships bytes around.
Example
Turn an AsyncRead into a stream of Result<BytesMut, Error>.
use tokio::fs::File; use tokio::io::AsyncRead; use tokio_util::codec::{FramedRead, BytesCodec}; let my_async_read = File::open("filename.txt").await?; let my_stream_of_bytes = FramedRead::new(my_async_read, BytesCodec::new());
Implementations
impl BytesCodec[src][−]
pub fn new() -> BytesCodec[src][−]
Creates a new BytesCodec for shipping around raw bytes.
Trait Implementations
impl Clone for BytesCodec[src][+]
impl Copy for BytesCodec[src]
impl Debug for BytesCodec[src][+]
impl Decoder for BytesCodec[src][+]
impl Default for BytesCodec[src][+]
impl Encoder<Bytes> for BytesCodec[src][+]
impl Eq for BytesCodec[src]
impl Hash for BytesCodec[src][+]
impl Ord for BytesCodec[src][+]
impl PartialEq<BytesCodec> for BytesCodec[src][+]
impl PartialOrd<BytesCodec> for BytesCodec[src][+]
impl StructuralEq for BytesCodec[src]
impl StructuralPartialEq for BytesCodec[src]
Auto Trait Implementations
impl RefUnwindSafe for BytesCodec
impl Send for BytesCodec
impl Sync for BytesCodec
impl Unpin for BytesCodec
impl UnwindSafe for BytesCodec
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src][+]
T: ?Sized,
impl<T> From<T> for T[src][+]
impl<T, U> Into<U> for T where
U: From<T>, [src][+]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src][+]
T: Clone,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src][+]
U: TryFrom<T>,