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.
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, 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, 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.
Trait Implementations§
impl Copy for Record
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Forget for Record
impl Freeze for Record
impl Move for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnsafeUnpin for Record
impl UnwindSafe for Record
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more