Skip to main content

EmptyBuilder

Trait EmptyBuilder 

Source
pub trait EmptyBuilder {
    // Required methods
    fn empty() -> Self;
    fn with_capacity(capacity: usize) -> Self;
}
Expand description

An octets builder that can be newly created empty.

Required Methods§

Source

fn empty() -> Self

Creates a new empty octets builder with a default size.

Source

fn with_capacity(capacity: usize) -> Self

Creates a new empty octets builder with a suggested initial size.

The builder may or may not use the size provided by capacity as the initial size of the buffer. It may very well be possible that the builder is never able to grow to this capacity at all. Therefore, even if you create a builder for your data size via this function, appending may still fail.

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.

Implementations on Foreign Types§

Source§

impl EmptyBuilder for BytesMut

Available on crate feature bytes only.
Source§

fn empty() -> Self

Source§

fn with_capacity(capacity: usize) -> Self

Source§

impl EmptyBuilder for Vec<u8>

Available on crate feature std only.
Source§

fn empty() -> Self

Source§

fn with_capacity(capacity: usize) -> Self

Source§

impl<A: Array<Item = u8>> EmptyBuilder for SmallVec<A>

Available on crate feature smallvec only.
Source§

fn empty() -> Self

Source§

fn with_capacity(capacity: usize) -> Self

Implementors§

Source§

impl<const N: usize> EmptyBuilder for Array<N>