Skip to main content

ChunkLength

Trait ChunkLength 

Source
pub trait ChunkLength {
    // Required method
    fn chunk_len(&self) -> usize;
}
Expand description

Reports the byte length of a stream chunk.

Implement this trait for custom chunk types that should be accepted by crate::TransferLimit without first converting them to Bytes.

Required Methods§

Source

fn chunk_len(&self) -> usize

Return the number of bytes represented by this chunk.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ChunkLength for &[u8]

Source§

impl ChunkLength for Box<[u8]>

Source§

impl ChunkLength for Vec<u8>

Source§

impl ChunkLength for Bytes

Source§

impl ChunkLength for BytesMut

Source§

impl<const N: usize> ChunkLength for [u8; N]

Implementors§