Trait BufSplit

Source
pub trait BufSplit {
    // Required method
    fn split_at(&mut self, at: usize) -> Self;

    // Provided method
    fn try_add_prefix(&mut self, _prefix: &[u8]) -> bool { ... }
}
Expand description

A trait that enables zero-copy sends to quiche. When buffers produced by the BufFactory implement this trait, quiche and h3 can supply the raw buffers to be sent, instead of slices that must be copied first.

Required Methods§

Source

fn split_at(&mut self, at: usize) -> Self

Split the buffer at a given point, after the split the old buffer must only contain the first at bytes, while the newly produced buffer must containt the remaining bytes.

Provided Methods§

Source

fn try_add_prefix(&mut self, _prefix: &[u8]) -> bool

Try to prepend a prefix to the buffer, return true if succeeded.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§