Skip to main content

assert_raw_format

Function assert_raw_format 

Source
pub fn assert_raw_format<F: SerializationFormat>()
Expand description

The raw-entity counterpart: assert that F, the format a caller states its already-encoded bytes are in, is the one the linked backend speaks.

EmbeddedRawPublisher::publish_raw was documented as taking “raw CDR-encoded data (must include CDR header)” and checked by nothing. This is that sentence, as a bound a caller can name.

The raw constructors do not take F today: Rust forbids a default type parameter on a function (invalid_type_param_default, deny-by-default future-compat lint), so create_publisher_raw<F = Cdr> does not exist and making them generic without a default would break every existing call site’s inference. A caller that wants the check states it explicitly:

assert_raw_format::<nros_serdes::format::Cdr>();