#[non_exhaustive]pub enum Error {
Show 16 variants
Sink,
SourceChanged,
TooLarge,
StringTooLong,
OutOfRange,
IndexFull,
OutOfOrder,
TimeWentBack,
Paused,
DistanceWentBack,
Unfinished,
GivenByLengths,
Undeclared,
Duplicate,
Reserved,
TooMany,
}Expand description
Why a message was not written.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Sink
The sink failed; write() returns its error. Nothing more can be written.
SourceChanged
The source wrote different messages the second time from those the first pass sized the file for. Nothing of the message was written.
TooLarge
The file would be 4 GiB or more, counting the bytes kept for the activity’s end. Nothing was written.
StringTooLong
A string is too long for its field. Nothing of the message was written.
OutOfRange
A value does not fit its field, or is the value FIT reserves for “none”, such as a
heart rate of 255, or a string holds a NUL; a time past DURATION_SECONDS_MAX or a
distance past DISTANCE_METERS_MAX as the field keeps it; or a leg
Leg::check refuses. Nothing of the message was written.
IndexFull
A lap, session, length, set or sensor past its limit, such as LAPS_MAX: its index
has no value left for it.
OutOfOrder
A call the activity is not ready for: anything before Writer::start or after
Writer::end, a record, lap, set, rest, pause or resume before the first session, a
pause while paused, a resume while running, an end with no session, a length outside a
pool swim, a set outside a training or HIIT session, a rest outside those and pool swims,
a length or set during a rest, a lap during a rest in a pool swim, a rest during a rest,
an end of a rest outside one, or a first leg moved to by hand. Nothing was written.
TimeWentBack
A time before one already written. Nothing was written.
Paused
A record, length or set while the timer is paused. Nothing was written.
DistanceWentBack
A total distance less than one already written. Nothing was written.
Unfinished
The source returned without Writer::end, so the file has no activity.
GivenByLengths
A record’s distance, speed or cadence in a pool swim, whose lengths give them. Nothing was written.
Undeclared
A developer or field this file did not declare: one from another file, or one the second pass did not declare again. Nothing was written.
Duplicate
A developer, field or value given twice where it may appear once. Nothing was written.
Reserved
A raw message or field the encoder writes itself, or another form of one; see
Writer::raw_message and Writer::record_with. Nothing was written.
TooMany
More developers or fields than the encoder holds; see
DEVELOPERS_MAX and its neighbours. Nothing was written.
Trait Implementations§
impl Copy for Error
impl Eq for Error
Source§impl Error for Error
impl Error for Error
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()