mavlink / rust-mavlink

MAVLink library for Rust.
https://mavlink.github.io/rust-mavlink/mavlink/
Apache License 2.0
158 stars 79 forks source link

Make embedded module public #210

Closed antonio-sc66 closed 11 months ago

antonio-sc66 commented 11 months ago

Embedded module redefines the Write and Read traits.

Right now it's a private module, when the library is compiled in embedded mode, the following problem occurs :

imagen

Write is non-accesible, both while checking the documentation, but more important, when you integrate this library into your code, you can't define a function that receives an argument that needs to implement the custom Read or Write trait.

Example:

pub fn send_command<W: Write>(
    &mut self,
    cmd: FooCommandMsgType,
    writer: &mut W,
) -> Result<u16, FooError> {

...

write_v2_msg(
                writer,
                foo_header,
                &foo_message,
            ),

...

The following cases only work when compiled in normal (non-embedded) modes.