#[non_exhaustive]pub struct DecodeOpts {
pub allow_unresolved_origin: bool,
}Expand description
Options controlling decode-time validation strictness (P0 pathless/ dead-card partial-decode).
The default (allow_unresolved_origin: false) is BYTE-IDENTICAL to
pre-P0 decode behavior: Error::MissingExplicitOrigin is raised for
any @N whose origin cannot be resolved (no canonical default AND no
explicit path_decl/override). When true, that ONE reject is
swallowed and the decode succeeds; the caller MUST query
crate::encode::Descriptor::unresolved_origin_indices on the
returned descriptor to learn which @N are unresolved (nothing extra
is recorded on the Descriptor itself).
INVARIANT (funds-load-bearing): this flag relaxes ONLY the
validate_explicit_origin_required outcome. No other decode check is
affected — placeholder-usage, multipath consistency, tap-script-tree
leaf validity, xpub-bytes validity, and (via
crate::chunk::reassemble_with_opts) per-chunk BCH, chunk-header
consistency, index-gap, and the derived-chunk-set-id / content-id
check all stay enforced regardless of this flag. The
Error::EmptyOriginOverride reject (P0.3) is likewise a DISTINCT,
always-fatal error class — never swallowed by this opt-in, even when
allow_unresolved_origin is true (fatal-in-partial).
#[non_exhaustive] (API-freeze, M-2): a future decode-relaxation option
can be added as a new field without a SemVer-major bump. Downstream
crates therefore cannot construct this with a struct literal — use
DecodeOpts::default (strict) or DecodeOpts::partial
(partial-allowing) instead.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allow_unresolved_origin: boolWhen true, Error::MissingExplicitOrigin is not raised at
decode time. Default false (strict — today’s behavior).
Implementations§
Source§impl DecodeOpts
impl DecodeOpts
Sourcepub fn partial() -> Self
pub fn partial() -> Self
Partial-allowing decode options (allow_unresolved_origin: true),
all other (future) options at their Default. The stable
constructor for the render-path opt-in (md decode/md inspect,
toolkit verify-bundle gate) — preferred over a struct literal
since DecodeOpts is #[non_exhaustive].
Trait Implementations§
Source§impl Clone for DecodeOpts
impl Clone for DecodeOpts
Source§fn clone(&self) -> DecodeOpts
fn clone(&self) -> DecodeOpts
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more