pub trait Buffer<'data> {
type Intermediate: ToBufferRef<'data>;
// Required method
fn to_to_buffer_ref(self) -> Self::Intermediate;
// Provided method
fn cap_at(self, len: usize) -> CapAt<'data, Self>
where Self: Sized { ... }
}Expand description
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.
Required Associated Types§
Sourcetype Intermediate: ToBufferRef<'data>
type Intermediate: ToBufferRef<'data>
Intermediate result of converting the T: Buffer into a BufferRef.
Required Methods§
Sourcefn to_to_buffer_ref(self) -> Self::Intermediate
fn to_to_buffer_ref(self) -> Self::Intermediate
Converts the T: Buffer into the intermediate step to BufferRef.