Skip to main content

max_serialized_size

Function max_serialized_size 

Source
pub const fn max_serialized_size(
    fields: &'static [Field],
    version: EncodingVersion,
) -> Option<usize>
Expand description

The whole payload a publisher hands the transport: encapsulation header plus the struct’s body, starting from offset 0.

None when the type is unbounded — the honest answer, and the one that keeps a caller from sizing a buffer off a floor. Reach for serialized_size(&self) (phase-380 W3) when an unbounded type still needs a number for THIS message.