Skip to main content

KernelError

Enum KernelError 

Source
#[non_exhaustive]
pub enum KernelError {
Show 16 variants NotFinite { parameter: &'static str, value: f64, }, OutOfRange { parameter: &'static str, value: f64, min: f64, max: f64, }, InsufficientData { found: usize, required: usize, context: &'static str, }, UnknownCardinalDirection { direction: Excerpt, }, BufferTooSmall { needed: usize, found: usize, }, CapacityExceeded { context: &'static str, needed: usize, capacity: usize, }, SingularSystem { context: &'static str, }, NotCovariance { context: &'static str, }, NotConverged { iterations: u32, residual: f64, }, Parse { what: &'static str, input: Excerpt, }, Indeterminate { quantity: &'static str, }, Missing { what: &'static str, }, Unrepresentable { what: &'static str, }, TimeReversed { by: Duration, }, VerticalDatumMismatch { required: VerticalDatum, found: VerticalDatum, }, OutsideValidity { data: &'static str, },
}
Expand description

Kernel operation failure.

No operation panics on caller data; every failure is reported through this type.

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

NotFinite

Parameter is NaN or infinite.

Fields

§parameter: &'static str

Parameter name.

§value: f64

Value supplied.

§

OutOfRange

Parameter is finite but out of range.

Fields

§parameter: &'static str

Parameter name.

§value: f64

Value supplied.

§min: f64

Minimum, inclusive.

§max: f64

Maximum, inclusive.

§

InsufficientData

Fewer items than required: interpolation nodes, route waypoints, fit samples.

Fields

§found: usize

Items present.

§required: usize

Items required.

§context: &'static str

Operation that required them.

§

UnknownCardinalDirection

Not one of the eight cardinal/intercardinal abbreviations.

Fields

§direction: Excerpt

Input, truncated.

§

BufferTooSmall

Caller-supplied output buffer too small.

Returned by slice-writing calls so a short buffer is an error, not a silent truncation.

Fields

§needed: usize

Values produced.

§found: usize

Buffer length.

§

CapacityExceeded

Inline store capacity exceeded.

Collections are fixed-capacity inline stores; their bounds are public constants, so callers can check beforehand.

Fields

§context: &'static str

What was being built.

§needed: usize

Items required.

§capacity: usize

Capacity.

§

SingularSystem

Linear system has no unique solution.

For a parametric fit: the sample courses do not constrain the requested coefficients (e.g. five coefficients from nodes on one semicircle).

Fields

§context: &'static str

System being solved.

§

NotCovariance

Matrix is not a valid covariance (symmetric positive definite): e.g. zero observation variance, collapsed innovation covariance.

Fields

§context: &'static str

Intended role of the matrix.

§

NotConverged

Iterative solver did not converge.

The deviation inverse fails this way when deviation changes faster than 1° per degree of heading, so several compass courses map to one magnetic course; the compass needs re-swinging.

Fields

§iterations: u32

Iterations run.

§residual: f64

Final residual.

§

Parse

String could not be parsed.

Fields

§what: &'static str

Expected value type.

§input: Excerpt

Input, truncated.

§

Indeterminate

Mathematically undefined for the inputs: rhumb line through a pole, direction of a zero vector, great circle between antipodes.

Fields

§quantity: &'static str

Undefined quantity.

§

Missing

Required input unavailable: snapshot without position, environment sample without tide, empty estimator history.

Fields

§what: &'static str

Missing input.

§

Unrepresentable

Result exists but is not representable: instant beyond range, counter overflow.

Fields

§what: &'static str

Unrepresentable quantity.

§

TimeReversed

Instants in the wrong order for the elapsed time requested (clock stepped back, or arguments swapped).

Fields

§by: Duration

Amount by which the later instant precedes the earlier.

§

VerticalDatumMismatch

Height referred to a different vertical datum than required.

Fields

§required: VerticalDatum

Required datum.

§found: VerticalDatum

Datum of the height.

§

OutsideValidity

Data requested outside its validity interval (leap-second table past expiry, magnetic model past epoch).

Fields

§data: &'static str

Requested data.

Trait Implementations§

Source§

impl Clone for KernelError

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 Debug for KernelError

Source§

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

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

impl Display for KernelError

Source§

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

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

impl Error for KernelError

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

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 KernelError

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 KernelError

Auto Trait Implementations§

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.