pub trait SeqElement: TailElement {
const STRIDE: usize;
}Expand description
A TailElement whose encoding has a fixed stride: every value
encodes to exactly STRIDE bytes
(STRIDE == MAX_ENCODED_LEN, and encode always writes STRIDE).
This fixed width is what lets a Seq<T> address element i at
SEQ_LEN_PREFIX + i*STRIDE with no per-element scan. Implemented for
the fixed-width wire primitives (u8..=u128, i16..=i128, bool),
[u8; N], and Address. Variable-length
encoders (Option<T>, BoundedString<N>, BoundedVec<T, N>) are
deliberately NOT SeqElement; they stay on the owned-decode path.
Required Associated Constants§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".