pub struct Fit {
pub header: FitHeader,
pub data: Vec<FitMessage>,
}
Fields§
§header: FitHeader
§data: Vec<FitMessage>
Implementations§
Source§impl Fit
impl Fit
Sourcepub fn read(buf: Vec<u8>) -> BinResult<Self>
pub fn read(buf: Vec<u8>) -> BinResult<Self>
Examples found in repository?
More examples
examples/read_fit.rs (line 7)
5fn main() {
6 let file = fs::read("tests/test.fit").unwrap();
7 let fit: Fit = Fit::read(file).unwrap();
8 for data in &fit.data {
9 match data {
10 FitMessage::Definition(msg) => {
11 println!("Definition: {:?}", msg.data);
12 }
13 FitMessage::Data(msg) => {
14 println!("Data: {:?}", msg.data);
15 }
16 }
17 }
18}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fit
impl RefUnwindSafe for Fit
impl Send for Fit
impl Sync for Fit
impl Unpin for Fit
impl UnwindSafe for Fit
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