pub struct Record { /* private fields */ }Expand description
One moment’s samples.
A record needs a value besides its timestamp; the encoder does not check that one is set.
use fit_encoder::{Record, Timestamp};
let r = Record::new(Timestamp::from_fit(1_133_481_600)).heart_rate(128);Implementations§
Source§impl Record
impl Record
Sourcepub const fn altitude(self, altitude: Altitude) -> Self
pub const fn altitude(self, altitude: Altitude) -> Self
The altitude, which with its source sets what ascent and descent count.
Sourcepub const fn heart_rate(self, bpm: u8) -> Self
pub const fn heart_rate(self, bpm: u8) -> Self
The heart rate in beats per minute, up to 254.
Sourcepub const fn cadence_rpm(self, rpm: u8) -> Self
pub const fn cadence_rpm(self, rpm: u8) -> Self
The cadence in revolutions, or strides, a minute, up to 254.
Sourcepub fn distance_advanced_meters(self, meters: f64) -> Self
pub fn distance_advanced_meters(self, meters: f64) -> Self
The distance covered since the last record that gave one, to the micrometre; the
writer keeps the activity’s total, up to
DISTANCE_METERS_MAX in whole centimetres.
Sourcepub fn distance_meters(self, meters: f64) -> Self
pub fn distance_meters(self, meters: f64) -> Self
The distance covered since the activity started, up to
DISTANCE_METERS_MAX once rounded to the centimetre;
less than a total already written is refused.
Sourcepub fn speed_meters_per_second(self, speed: f64) -> Self
pub fn speed_meters_per_second(self, speed: f64) -> Self
The speed, up to 65.534 m/s once rounded to the millimetre a second.
Sourcepub const fn power_watts(self, watts: u16) -> Self
pub const fn power_watts(self, watts: u16) -> Self
The power in watts, up to 65,534.
Sourcepub const fn temperature_celsius(self, celsius: i8) -> Self
pub const fn temperature_celsius(self, celsius: i8) -> Self
The temperature in degrees Celsius, from -128 to 126.