Skip to main content

generate_object_dictionary

Function generate_object_dictionary 

Source
pub fn generate_object_dictionary(eds: &Eds, fn_name: &str) -> String
Expand description

Emit Rust source for a pub fn <fn_name>() -> canopen_rs::ObjectDictionary<N> that inserts every object in eds, with N sized to fit exactly.

The generated code refers to everything by absolute canopen_rs:: path, so it compiles regardless of the including module’s imports (the crate need only depend on canopen-rs).