Skip to main content

assert_registry_layout

Function assert_registry_layout 

Source
pub fn assert_registry_layout<T: AstrsMessage>() -> Result<()>
Expand description

Checks a type’s layout against the std registry (§24.3).

This is the conformance gate every implementation in this module runs in its own test: it is the only check that can catch “my encoder and my decoder agree with each other, and both disagree with the spec”.

§Errors

DataError::TypeUrn when the URN is unknown or its parameters do not validate, and DataError::TypeMismatch when the registry’s layout is not the one the type produces.

§Examples

use astrs_node_api::message::{Pose, assert_registry_layout};

assert_registry_layout::<Pose>()?;