Enum omf::validate::Reason

source ·
pub enum Reason {
Show 16 variants NotFinite, NotGreaterThanZero, NotUnitVector([f64; 3], f64), NotOrthogonal([f64; 3], [f64; 3]), OctreeNotPowerOfTwo([u32; 3]), GridTooLarge(Vec<u64>), AttrLocationWrongForGeom(Location, &'static str), AttrLocationWrongForAttr(Location, &'static str), AttrLengthMismatch(u64, u64), MinMaxOutOfOrder(NumberRange), InvalidData(InvalidData), ZipMemberMissing(String), NotUnique(String), SoftNotUnique(String), MoreErrors(u32), MoreWarnings(u32),
}
Expand description

Validation failure reason.

Variants§

§

NotFinite

A floating-point number is NaN, Inf, or -Inf.

§

NotGreaterThanZero

A size is zero or less.

§

NotUnitVector([f64; 3], f64)

Vector must have length one.

§

NotOrthogonal([f64; 3], [f64; 3])

Vectors must be at right angles.

§

OctreeNotPowerOfTwo([u32; 3])

A sub-blocked model says it uses octree mode but the sub-block counts are not powers of two.

§

GridTooLarge(Vec<u64>)

A grid or block model has size greater than 2³² in any direction.

§

AttrLocationWrongForGeom(Location, &'static str)

Attribute using a location that doesn’t exist on the containing geometry.

§

AttrLocationWrongForAttr(Location, &'static str)

Attribute using a location that is impossible for the attribute data.

§

AttrLengthMismatch(u64, u64)

Attribute length doesn’t match the geometry and location.

§

MinMaxOutOfOrder(NumberRange)

Minimum is greater than maximum.

§

InvalidData(InvalidData)

The data inside an array is invalid.

§

ZipMemberMissing(String)

A data file or index is missing from the zip.

§

NotUnique(String)

A field that must be unique is duplicated.

§

SoftNotUnique(String)

A field that should be unique is duplicated.

§

MoreErrors(u32)

Ran into the validation message limit.

§

MoreWarnings(u32)

Ran into the validation message limit.

Implementations§

source§

impl Reason

source

pub fn is_error(&self) -> bool

True if the reason is an error, false if it is a warning.

Trait Implementations§

source§

impl Clone for Reason

source§

fn clone(&self) -> Reason

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for Reason

source§

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

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

impl Display for Reason

source§

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

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

impl Error for Reason

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 Reason

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for Reason

Auto Trait Implementations§

§

impl Freeze for Reason

§

impl RefUnwindSafe for Reason

§

impl Send for Reason

§

impl Sync for Reason

§

impl Unpin for Reason

§

impl UnwindSafe for Reason

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, dst: *mut T)

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

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

source§

fn __clone_box(&self, _: Private) -> *mut ()

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§

default 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.