Skip to main content

ChainComplexResolver

Trait ChainComplexResolver 

Source
pub trait ChainComplexResolver<const INLINE_BYTES: usize, H>: Sealed {
    // Required method
    fn resolve<'a>(
        &self,
        input: TermValue<'a, INLINE_BYTES>,
    ) -> Result<TermValue<'a, INLINE_BYTES>, ShapeViolation>;
}
Expand description

ADR-036 resolver trait: ψ_2 — SimplicialComplex → ChainComplex per ADR-035.

Parameterized by the model’s H-axis (H: Hasher per ADR-022 D5) so resolver impls compute content-addressed fingerprints using the model’s chosen hash impl. Sealed via [__sdk_seal::Sealed]: only the SDK resolver! macro emits impls. Foundation provides a Null impl whose resolve emits the RESOLVER_ABSENT shape violation.

ADR-060: resolve takes and returns a source-polymorphic crate::pipeline::TermValue const-generic over the application’s foundation-derived inline width (INLINE_BYTES = carrier_inline_bytes::<B>()). The resolver constructs whichever carrier variant its output requires — Inline for structural identities that fit the inline width, Borrowed into resolver-owned scratch, or Stream for unbounded structural sequences. There is no caller-supplied &mut [u8] scratch and no per-ψ-stage byte-width ceiling (ADR-060 amends the ADR-036/ADR-041 writer-style surface).

Required Methods§

Source

fn resolve<'a>( &self, input: TermValue<'a, INLINE_BYTES>, ) -> Result<TermValue<'a, INLINE_BYTES>, ShapeViolation>

Resolve per-value content for this category.

§Errors

Returns crate::enforcement::ShapeViolation when the resolver cannot produce content (e.g., the foundation Null impl carrying the RESOLVER_ABSENT discriminator).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<const INLINE_BYTES: usize, H> ChainComplexResolver<INLINE_BYTES, H> for NullChainComplexResolver<H>

Source§

impl<const INLINE_BYTES: usize, H> ChainComplexResolver<INLINE_BYTES, H> for NullResolverTuple

ADR-036: NullResolverTuple satisfies ChainComplexResolver<H> directly so the HasChainComplexResolver<H> accessor can return self cast to &dyn ChainComplexResolver<H>. The resolve method emits the RESOLVER_ABSENT shape violation — recoverable via Term::Try’s default-propagation handler (ADR-022 D3 G9).