pub struct LocalDefinitions { /* private fields */ }Expand description
The 16-slot local-definition table.
Each Definition message stores itself at index local_mesg_num (0..=15),
overwriting any previous occupant. Each Data message looks up its slot
to learn how to parse its bytes.
At the start of a new chained FIT file (multi-FIT) the table must be
fully cleared via Self::clear.
Implementations§
Source§impl LocalDefinitions
impl LocalDefinitions
Sourcepub fn get(&self, local_mesg_num: u8) -> Option<&MessageDefinition>
pub fn get(&self, local_mesg_num: u8) -> Option<&MessageDefinition>
Borrow the definition stored in local_mesg_num’s slot, if any.
Sourcepub fn require(
&self,
local_mesg_num: u8,
) -> Result<&MessageDefinition, FitError>
pub fn require( &self, local_mesg_num: u8, ) -> Result<&MessageDefinition, FitError>
Borrow or error with FitError::UndefinedLocalMesgNum.
Sourcepub fn set(&mut self, local_mesg_num: u8, def: MessageDefinition)
pub fn set(&mut self, local_mesg_num: u8, def: MessageDefinition)
Install a definition, overwriting any prior occupant.
Trait Implementations§
Source§impl Debug for LocalDefinitions
impl Debug for LocalDefinitions
Source§impl Default for LocalDefinitions
impl Default for LocalDefinitions
Source§fn default() -> LocalDefinitions
fn default() -> LocalDefinitions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LocalDefinitions
impl RefUnwindSafe for LocalDefinitions
impl Send for LocalDefinitions
impl Sync for LocalDefinitions
impl Unpin for LocalDefinitions
impl UnsafeUnpin for LocalDefinitions
impl UnwindSafe for LocalDefinitions
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