Skip to content

Add data types for messages #13

Open
@robinkrahl

Description

@robinkrahl

Thank you for this crate! It really takes the pain out of parsing my Garmin logs. 👍

I think it could be even more useful if it would contain structs for the message types, with each message field being a field of the struct. As you are already parsing the profile in build.rs and auto-generating code from it, I think this should not be too complicated. For example, a representation of an Activity message could look like this:

pub struct Activity {
    pub total_timer_time: Option<f64>,
    pub num_sessions: Option<u16>,
    pub r#type: Option<fitparser::profile::field_type::Activity>,
    // ....
}

impl TryFrom<fitparser::FitDataRecord> for Activity {
    // ...
}

This would make it much easier to use the crate and also to discover the relevant message types and fields from the API docs. What are your thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions