#[non_exhaustive]pub enum DecodeError {
Dar(DarError),
Proto(DecodeError),
UnsupportedVersion,
PackageIdMismatch {
declared: String,
computed: String,
},
UnsupportedHashFunction(i32),
UnsupportedMinor {
minor: String,
supported: String,
},
InPackage {
name: String,
source: Box<DecodeError>,
},
}Expand description
An error decoding Daml-LF package bytes.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Dar(DarError)
Reading the DAR container failed.
Proto(DecodeError)
The protobuf bytes were malformed.
UnsupportedVersion
The package is not Daml-LF 2.x (this decoder only supports LF 2.x).
PackageIdMismatch
The archive’s payload does not hash to the package id it declares.
Refused: that id is the package’s identity — it is what generated
bindings embed as PACKAGE_ID and what cross-package references resolve
through — so accepting a mismatch means addressing a package by a name
its contents do not answer to.
Fields
UnsupportedHashFunction(i32)
The archive declares a hash function this build does not implement.
UnsupportedMinor
The package is LF 2.x, but a minor this decoder was not built against. Refused rather than decoded: prost drops fields it does not know, so a newer minor would otherwise yield silently incomplete bindings — a template missing a field decodes, compiles, and then fails on the wire.
Fields
InPackage
A decode failure attributed to a specific package in the DAR.
Fields
source: Box<DecodeError>The underlying failure.
Trait Implementations§
Source§impl Debug for DecodeError
impl Debug for DecodeError
Source§impl Display for DecodeError
impl Display for DecodeError
Source§impl Error for DecodeError
impl Error for DecodeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()