Trait buffer::Buffer [] [src]

pub trait Buffer<'data> {
    type Intermediate: ToBufferRef<'data>;
    fn to_to_buffer_ref(self) -> Self::Intermediate;

    fn cap_at(self, len: usize) -> CapAt<'data, Self>
    where
        Self: Sized
, { ... } }

Trait for types that can act as buffer for bytes.

It should be accepted as trait bound for functions that accept buffers, and should immediately be converted to BufferRef using the with_buffer function.

Associated Types

Intermediate result of converting the T: Buffer into a BufferRef.

Required Methods

Converts the T: Buffer into the intermediate step to BufferRef.

Provided Methods

Caps the buffer at the specified byte index.

This means that no more than len bytes will be written to the buffer.

Implementors