Skip to main content

DecodeOpts

Struct DecodeOpts 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§allow_unresolved_origin: bool

When true, Error::MissingExplicitOrigin is not raised at decode time. Default false (strict — today’s behavior).

Implementations§

Source§

impl DecodeOpts

Source

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

Source§

fn clone(&self) -> DecodeOpts

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 DecodeOpts

Source§

impl Debug for DecodeOpts

Source§

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

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

impl Default for DecodeOpts

Source§

fn default() -> DecodeOpts

Returns the “default value” for a type. Read more
Source§

impl Eq for DecodeOpts

Source§

impl PartialEq for DecodeOpts

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for DecodeOpts

Auto Trait Implementations§

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