Skip to main content

Error

Enum Error 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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; 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§

Source§

impl Clone for Error

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Error

Source§

impl Debug for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Error

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Error

Source§

impl Error for Error

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl PartialEq for Error

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Error

Auto Trait Implementations§

§

impl Forget for Error

§

impl Freeze for Error

§

impl Move for Error

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnsafeUnpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.