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)
5 6 7 8 9 10 11 12 13 14 15 16 17 18
fn main() {
let file = fs::read("tests/test.fit").unwrap();
let fit: Fit = Fit::read(file).unwrap();
for data in &fit.data {
match data {
FitMessage::Definition(msg) => {
println!("Definition: {:?}", msg.data);
}
FitMessage::Data(msg) => {
println!("Data: {:?}", msg.data);
}
}
}
}
Trait Implementations§
Auto Trait Implementations§
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