Errors
- file format 6
- Rust SDK 1.0 preview
Every failure is an Error with a kind, a message and JSON details. The kind is the contract: one of 22 fixed strings, the same in every implementation.
On this page, Result<T> is std::result::Result<T, plxi_sdk::Error>.
Every public struct and enum with a public field or variant is marked #[non_exhaustive]: code outside the crate builds one through its constructors and matches an enum with a _ arm.
The 22 kinds
Each kind's meaning, the step that reports it, and its test cases are listed on plxi.org. Error kinds
Reserved shard_unsupported_spec and shard_quality_below_threshold are reserved; the SDK never returns them.
Nineteen kinds are named by the full specification. io, unsupported and internal come from implementations: a file that cannot be read, a feature this SDK does not have, and a defect in the SDK itself.
Structs
#[non_exhaustive]
#[derive(Debug, Clone, PartialEq)]
pub struct Error { /* private fields */ }
impl Display for Error
impl Error for Error- Summary
An SDK error: a kind, a message for people, and JSON details.
- Spec
- Spec §9
pub fn kind(&self) -> ErrorKind- Summary
The kind: the stable conformance key.
- Parameters
- None.
- Returns
ErrorKind- Spec
- Spec §9
pub fn message(&self) -> &str- Summary
A plain-language description for a person. Not part of the contract.
- Parameters
- None.
- Returns
&str- Spec
- Spec §9
pub fn details(&self) -> &Value- Summary
Kind-specific details, always a JSON object.
- Parameters
- None.
- Returns
&Value- Spec
- Spec §9
pub fn to_json(&self) -> String- Summary
{"kind": ..., "message": ..., "details": {...}}as one JSON text.- Parameters
- None.
- Returns
String- Spec
- Spec §9
Enums
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum ErrorKind {
Io,
InvalidHeader,
UnsupportedVersion,
InvalidFooter,
ChecksumMismatch,
HeaderFooterMismatch,
RecordCountMismatch,
InvalidUtf8,
InvalidRecord,
Json,
AppendixInvalid,
AppendixCrcMismatch,
AppendixAlignment,
AppendixLegacyVersion,
SectionTypeMismatch,
DanglingEmbref,
MergeConflict,
ShardUnsupportedSpec,
ShardQualityBelowThreshold,
LimitExceeded,
Unsupported,
Internal,
}
impl Display for ErrorKind- Summary
The fixed, language-neutral name of a failure. A later release may add a kind; code matches with a
_arm.- Variants
IoioThe operating system refused a read or write.InvalidHeaderinvalid_headerToo short to be a PLXI file, or the header line breaks the grammar.UnsupportedVersionunsupported_versionThe header or footer names a format version other than 6.InvalidFooterinvalid_footerThe footer is malformed or does not describe the file's layout.ChecksumMismatchchecksum_mismatchThe SHA-256 digest does not match the footer.HeaderFooterMismatchheader_footer_mismatchA final header disagrees with the footer, or is neither final nor placeholder.RecordCountMismatchrecord_count_mismatchThe record lines do not match the footer'srecord_count.InvalidUtf8invalid_utf8The body is not valid UTF-8.InvalidRecordinvalid_recordA line is not a JSON object, has no stringk, or the appendix marker is misplaced or missing.JsonjsonA line is not valid JSON, or a typed record fails its schema.AppendixInvalidappendix_invalidThe embedded CSDT container fails a structural check.AppendixCrcMismatchappendix_crc_mismatchA CRC32C inside or about the appendix fails.AppendixAlignmentappendix_alignmentAn appendix offset or alignment exponent is out of bounds.AppendixLegacyVersionappendix_legacy_versionMerge was given a version-3 or version-4 appendix.SectionTypeMismatchsection_type_mismatchA bound embedding target is not a Compact section.DanglingEmbrefdangling_embrefA bound embedding target does not resolve.MergeConflictmerge_conflictMerge cannot combine the inputs.ShardUnsupportedSpecshard_unsupported_specThe shard spec cannot be served by this pack.ShardQualityBelowThresholdshard_quality_below_thresholdThe shard's quality score is below the caller's minimum.LimitExceededlimit_exceededA caller cap or the platform's address width cannot hold a value.UnsupportedunsupportedA well-formed feature this implementation does not have.InternalinternalA defect in the SDK itself (a caught panic, an unmapped error).
- Spec
- Spec §9
pub const ALL: [ErrorKind; 22]- Summary
Every kind, in the order of the error-kind list on plxi.org.
- Spec
- Spec §9
pub fn as_str(&self) -> &'static str- Summary
The kind's fixed string, as used by the conformance cases.
- Parameters
- None.
- Returns
&'static str- Spec
- Spec §9
pub fn from_key(key: &str) -> Option<ErrorKind>- Summary
The kind whose conformance key is
key.- Parameters
key: &str
- Returns
Option<ErrorKind>- Spec
- Spec §9
Type aliases
pub type Result<T> = std::result::Result<T, Error>;© 2020-2026 Cintile Inc. All Rights Reserved.
Anyone may implement this format. Copying or republishing the text of this specification requires permission from Cintile Inc.