[][src]Function fitsdk::match_message_scale

pub fn match_message_scale(m: MessageType) -> &'static MatchScaleFn

Determines whether any SDK-defined Message defines a scale for any of its fields.

The method is called with a MessageType argument and returns a static closure which is called with a field_id usize and yields an Option<f32>.

Example

let message_type = MessageType::Workout;
let parsed_value = 14;
let scale_fn = match_message_scale(message_type);
let scale = scale_fn(parsed_value);
assert_eq!(scale, Some(100.0));