Skip to main content

Check

Enum Check 

Source
#[non_exhaustive]
pub enum Check {
Show 115 variants TrailerMagic, TrailerCrc32c, HeaderMagic, HeaderVersion, HeaderDirOffset, HeaderFlagsReserved, HeaderTotalUncompressedSize, DirDescriptor, DirOverlap, DirChunkExtent, DirHeadFirst, PresenceHead, PresenceMeta, PresenceLtbl, PresenceLayr, PresenceAuth, PresenceZdic, HeadVersion, HeadFrame, HeadTotalLayers, HeadLayerHeight, HeadBuildDims, HeadDisplayPixels, HeadMultiSectorFlag, AuthVersion, AuthCipherKnown, AuthFrame, MetaJson, MetaVersion, MetaRequiredFields, MetaTimeInteger, MetaExposure, MetaLayerHeight, MetaMaterialsShape, MetaSectorsShape, MetaSectorMaterialIndex, MetaCureCurve, MetaTemperatureRange, PwmRange, ProfProfileType, ProfProfileIdentity, ProfSettingsTimeInteger, ProfSettingsExposure, ProfSettingsLayerHeight, ProfCureCurve, ProfProfileUuid, ProfMaterialsShape, LrovJson, LrovTimeInteger, LrovOrphan, PrevFlags, PrevPngSignature, VoxlSignature, ExtdFrame, ExtdExtType, ExtdFlags, ExtdCritical, LtblVersion, LtblLayerCount, LtblEntrySize, LtblEntryCount, LtblLayerIndexRange, LtblSectorIdsAscending, LtblSectorIdUnique, LtblFirstEntryIsSectorZero, LtblFirstLayrInRange, LtblFirstLrovNull, LtblFirstLrovInRange, LtblOffsetWithinChunk, LtblSlicesDisjoint, LayrVersion, LayrContentSizePresent, LayrFrameDecompressedSize, FrameAllocationBound, LayrDictIdMatch, LayrDictIdAbsent, ZdicVersion, ZdicDictSize, ZdicDictIdMatch, ZdicSingle, LhasFrame, LhasHashAlgorithm, LhasLayerCount, LhasRootRecompute, LhasLeafMatch, ReeTag, ReeVarint, ReePlanes, ReeFirstValue, ReeNoRunCountZero, ReeRunLengths, ReeGrayscaleRuns, ReeGrayscaleAllBinary, ReeSplitAllBinary, ReeSplitThreshold, ReeSplitPositions, ReeAttachPositions, ReeAttachCount, ReeAttachBits, ReeAttachThreshold, ReeEndPositions, ReeNoTrailingBytes, ReeDataSize, SectorPartition, CryptModeEmpty, CryptPasswordSectionLen, CryptMachineSectionLen, CryptArgon2Budget, CryptChunkFlags, CryptTagVerify, CryptUnitIndexBinding, CryptKeyUnwrap, CryptRecipientEntry, CryptLowOrderPoint, CryptNoKey,
}
Expand description

A named conformance check, mirroring the corpus convention <group>.<rule>.

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

TrailerMagic

LEND magic is absent from the last 8 bytes.

§

TrailerCrc32c

Trailer CRC-32C does not match bytes[0 .. file_len-8].

§

HeaderMagic

LUMN magic is absent at offset 0.

§

HeaderVersion

header.version is not recognized.

§

HeaderDirOffset

header.dir_offset is outside the file, or the directory does not fit.

§

HeaderFlagsReserved

header.flags sets a reserved bit (0, 2 or 4).

§

HeaderTotalUncompressedSize

header.total_uncompressed_size is non-zero and wrong.

§

DirDescriptor

A chunk descriptor could not be read.

§

DirOverlap

Two chunks overlap.

§

DirChunkExtent

A chunk’s stored extent lies outside the file, or inside the directory.

§

DirHeadFirst

The first chunk is not HEAD.

§

PresenceHead

A required chunk is missing.

§

PresenceMeta

META is missing.

§

PresenceLtbl

LTBL is missing.

§

PresenceLayr

LAYR is missing.

§

PresenceAuth

The ENCRYPTED flag is set but AUTH is absent, or vice versa.

§

PresenceZdic

Exactly one ZDIC is required (or forbidden) by the LAYR frames.

§

HeadVersion

head_version is not recognized.

§

HeadFrame

encoder_name_len exceeds 256, or the chunk is not exactly the fixed fields plus the name.

§

HeadTotalLayers

total_layers == 0, or disagrees with LTBL.layer_count.

§

HeadLayerHeight

layer_height_um == 0.

§

HeadBuildDims

A build dimension is zero.

§

HeadDisplayPixels

display_width_px * display_height_px == 0.

§

HeadMultiSectorFlag

MULTI_SECTOR is set without a layer carrying more than one sector, or clear while one does.

§

AuthVersion

auth_version is not recognized.

§

AuthCipherKnown

cipher_id is not A256 or C20P.

§

AuthFrame

The AUTH payload is too short for its declared sections.

§

MetaJson

The META payload is not a JSON object.

§

MetaVersion

meta_version is absent or unrecognized.

§

MetaRequiredFields

A required META field is absent.

§

MetaTimeInteger

A META duration is not an integer number of milliseconds.

§

MetaExposure

An exposure time is not > 0.

§

MetaLayerHeight

layer_height_um is not > 0.

§

MetaMaterialsShape

materials, when present, is not a non-empty array of named entries.

§

MetaSectorsShape

sectors, when present, is not an array of objects with unique ids >= 1.

§

MetaSectorMaterialIndex

A sector’s material_index addresses no non-empty materials array.

§

MetaCureCurve

A cure curve has a non-positive dp_um/ec_mj_cm2 or a negative e0_mj_cm2.

§

MetaTemperatureRange

A temperature is outside [0.0, 120.0].

§

PwmRange

A light_pwm or bottom_light_pwm is outside 0..=255, in any payload that carries one (section 4.2).

§

ProfProfileType

profile_type is not one of material, printer, combined.

§

ProfProfileIdentity

profile_name or profile_version is empty.

§

ProfSettingsTimeInteger

A profile duration is not an integer number of milliseconds.

§

ProfSettingsExposure

A profile exposure time is not > 0.

§

ProfSettingsLayerHeight

A profile layer_height_um is not > 0.

§

ProfCureCurve

A profile cure curve is out of range.

§

ProfProfileUuid

profile_uuid is not a well-formed UUID string.

§

ProfMaterialsShape

Profile materials are malformed.

§

LrovJson

The payload is not a JSON object.

§

LrovTimeInteger

An overridden duration is not an integer number of milliseconds.

§

LrovOrphan

An LROV chunk is referenced by no entry. Several entries naming one chunk is how an override set covers a range of pairs, and is legal.

§

PrevFlags

A reserved flag bit is set, or the role is outside 0-3.

§

PrevPngSignature

The payload does not begin with the PNG signature (strict mode).

§

VoxlSignature

The payload is neither VOXL V2 nor a VOXL V1 document (strict mode).

§

ExtdFrame

The payload is shorter than the 8-byte frame.

§

ExtdExtType

ext_type is not four ASCII characters.

§

ExtdFlags

A reserved flag bit is set.

§

ExtdCritical

An unimplemented extension carries critical = 1.

§

LtblVersion

table_version is not recognized.

§

LtblLayerCount

layer_count disagrees with HEAD.total_layers.

§

LtblEntrySize

entry_size < 28, or the entries do not fit the chunk.

§

LtblEntryCount

The entries do not account for every layer, or entry_count disagrees with the sum of 1 + additional_sector_count over each layer’s first entry, or a non-first entry carries a non-zero count.

§

LtblLayerIndexRange

A read or a table entry names a layer the table does not describe.

§

LtblSectorIdsAscending

Sector ids do not ascend within a layer.

§

LtblSectorIdUnique

The same sector id appears twice on one layer.

§

LtblFirstEntryIsSectorZero

A layer’s first entry is not sector 0’s.

§

LtblFirstLayrInRange

first_layr is not the directory index of a LAYR chunk.

§

LtblFirstLrovNull

An LROV chunk no entry names carries a payload no named chunk carries.

§

LtblFirstLrovInRange

first_lrov is neither 0 nor the directory index of an LROV chunk.

§

LtblOffsetWithinChunk

data_offset + data_size exceeds the LAYR chunk’s decompressed output.

§

LtblSlicesDisjoint

Two slices of one LAYR chunk overlap.

§

LayrVersion

layr_version is not recognized.

§

LayrContentSizePresent

A frame carries no content size, so a reader cannot size its output.

§

LayrFrameDecompressedSize

A frame did not decompress to the size it declares.

§

FrameAllocationBound

A frame’s declared output exceeds what its stored size may expand to.

§

LayrDictIdMatch

A frame’s dictionary ID disagrees with ZDIC.

§

LayrDictIdAbsent

A frame reports no dictionary while the file carries ZDIC.

§

ZdicVersion

zdic_version is not recognized.

§

ZdicDictSize

dict_size exceeds ZDIC_DICTSIZE_MAX, or the bytes are missing.

§

ZdicDictIdMatch

dict_id disagrees with the LAYR frames.

§

ZdicSingle

More than one non-null ZDIC chunk is present.

§

LhasFrame

The payload is too short for its header and hashes.

§

LhasHashAlgorithm

hash_algorithm is not 0x01 (SHA-256).

§

LhasLayerCount

layer_count disagrees with HEAD.total_layers.

§

LhasRootRecompute

The recomputed Merkle root differs from the stored one.

§

LhasLeafMatch

A layer’s recomputed leaf hash differs from the stored one (strict mode).

§

ReeTag

A layer carries an encoding tag other than 0x00-0x03.

§

ReeVarint

A varint is overlong, truncated, or longer than 10 bytes.

§

ReePlanes

The four plane lengths of a varint array describe planes that are not prefix-closed, or that hold more bytes than the array’s varints use (strict); or a value needs more than four planes to encode.

§

ReeFirstValue

A binary REE first_value is neither 0x00 nor 0xFF.

§

ReeNoRunCountZero

The non-canonical run_count == 0 form (strict mode).

§

ReeRunLengths

A stored run length is zero, or the lengths do not sum to total_pixels (strict).

§

ReeGrayscaleRuns

Adjacent grayscale runs carry the same value, or a run is empty (strict).

§

ReeGrayscaleAllBinary

An all-0x00/0xFF layer is stored as grayscale REE (strict).

§

ReeSplitAllBinary

An all-0x00/0xFF layer is stored as split REE, with no anti-aliasing to overlay (strict).

§

ReeSplitThreshold

The split binary component does not threshold at v >= 128 (strict).

§

ReeSplitPositions

Split overlay positions are not strictly increasing, or out of range.

§

ReeAttachPositions

Attached-form escapes are not strictly increasing, fall outside the layer, or do not sit strictly inside the core run they belong to.

§

ReeAttachCount

aa_pixel_count disagrees with the pixels the attachment bits and escapes describe.

§

ReeAttachBits

An attachment bit addresses a run that does not exist, or a run of one pixel claims both of its ends, or padding bits past the last run are set (strict).

§

ReeAttachThreshold

An attached-form overlay value is 0x00/0xFF, or does not threshold to the core run it sits in (strict).

§

ReeEndPositions

The decoded stream does not end exactly at total_pixels.

§

ReeNoTrailingBytes

Bytes follow the end of a layer’s REE stream.

§

ReeDataSize

A layer’s data_size does not match its decoded stream.

§

SectorPartition

Sector masks of one layer overlap (strict mode).

§

CryptModeEmpty

AUTH.mode has no bit set.

§

CryptPasswordSectionLen

The password section is shorter than its fixed 65 bytes.

§

CryptMachineSectionLen

The machine section holds no complete recipient entry.

§

CryptArgon2Budget

Argon2id parameters exceed the reader’s budget.

§

CryptChunkFlags

A chunk’s encrypted flag disagrees with the file’s ENCRYPTED flag.

§

CryptTagVerify

An AEAD tag did not verify.

§

CryptUnitIndexBinding

A LAYR frame’s associated data did not bind it to its directory index.

§

CryptKeyUnwrap

A wrapped session key did not unwrap.

§

CryptRecipientEntry

A machine recipient entry is malformed.

§

CryptLowOrderPoint

An X25519 exchange produced the all-zero shared secret.

§

CryptNoKey

No key could be recovered: wrong password, or no matching recipient.

Implementations§

Source§

impl Check

Source

pub fn name(self) -> &'static str

The <group>.<rule> name, verbatim as the conformance corpus spells it.

Source

pub fn is_strict_only(self) -> bool

Whether the specification marks this check strict-mode only ([section 11.5]).

A loose-mode read must not fail these; a strict validator must.

Trait Implementations§

Source§

impl Clone for Check

Source§

fn clone(&self) -> Check

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 Check

Source§

impl Debug for Check

Source§

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

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

impl Display for Check

Source§

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

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

impl Eq for Check

Source§

impl Hash for Check

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for Check

Source§

fn cmp(&self, other: &Check) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for Check

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl PartialOrd for Check

Source§

fn partial_cmp(&self, other: &Check) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for Check

Auto Trait Implementations§

§

impl Freeze for Check

§

impl RefUnwindSafe for Check

§

impl Send for Check

§

impl Sync for Check

§

impl Unpin for Check

§

impl UnsafeUnpin for Check

§

impl UnwindSafe for Check

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V