Skip to main content

EncodedSize

Trait EncodedSize 

pub trait EncodedSize: BinEncodable {
    const LEN: usize;
}
Expand description

A trait to return the size of a type as it will be encoded in DNS

it does not necessarily equal core::mem::size_of, though it might, especially for primitives

Required Associated Constants§

const LEN: usize

Number of bytes used when encoding the type

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§

§

impl EncodedSize for u16

§

const LEN: usize = 2

Implementors§

§

impl EncodedSize for Header

§

const LEN: usize = 12