pub trait EncodeSize {
// Required method
fn encode_size(&self) -> usize;
}
Expand description
Trait for types that can provide their encoded size in bytes.
This must be implemented by all encodable types. For types implementing FixedSize, this trait is implemented automatically. For variable-size types, this requires calculating the size based on the value.
Required Methods§
Sourcefn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).