Skip to main content

fit_encoder/
lib.rs

1#![doc = include_str!("../README.md")]
2#![no_std]
3#![warn(missing_docs)]
4#![cfg_attr(docsrs, feature(doc_cfg))]
5#![cfg_attr(
6    not(test),
7    deny(
8        clippy::indexing_slicing,
9        clippy::panic,
10        clippy::unwrap_used,
11        clippy::expect_used,
12        clippy::arithmetic_side_effects
13    )
14)]
15
16#[cfg(feature = "alloc")]
17extern crate alloc;
18#[cfg(any(test, feature = "std"))]
19extern crate std;
20
21mod crc;
22mod developer;
23mod encoder;
24mod messages;
25mod raw;
26mod types;
27
28pub use crc::Crc;
29pub use developer::{
30    Dev, DevField, DevType, Developer, Extra, FieldDescription, InLap, InRecord, InSession, Kind,
31    LapField, RecordField, Scalar, SessionField, Summary, DEVELOPERS_MAX, DEVELOPER_FIELDS_MAX,
32    FIELD_NAME_MAX, SUMMARY_BYTES_MAX, UNITS_MAX,
33};
34#[cfg(feature = "std")]
35pub use encoder::IoSink;
36pub use encoder::{
37    size, write, Error, FinishError, FnSink, Full, OnePass, Options, PatchSink, Sink, SliceSink,
38    WriteError, Writer,
39};
40#[cfg(feature = "alloc")]
41pub use encoder::{to_vec, VecSink};
42#[cfg(feature = "async")]
43pub use encoder::{
44    write_async, AsyncOnePass, AsyncPatchSink, AsyncSink, AsyncWriter, ASYNC_WRITE_LEN,
45};
46#[cfg(any(feature = "embedded-io", feature = "embedded-io-async"))]
47pub use encoder::{EmbeddedIo, EmbeddedIoError};
48pub use messages::{
49    Altitude, Device, Exercise, LapTrigger, Leg, Length, Pool, Record, Set, PRODUCT_NAME_MAX,
50    SPORT_NAME_MAX,
51};
52pub use raw::{RawField, RAW_FIELDS_MAX};
53pub use types::{
54    BaseType, ExerciseCategory, Manufacturer, Position, Sport, SubSport, SwimStroke, Timestamp,
55    FIT_EPOCH_UNIX,
56};