Core Results
Canonical OpenSpec capability for Core Results.
Document layout: Feature capability layoutConforming
## Purpose## Requirements
Core.Results Specification
Purpose
Canonical Result<T,E> error-handling primitives for fallible Beskid corelib operations.
Requirements
Requirement: Result type and predicates: Decision [D-CORE-PRIM-0140]
The Beskid standard SHALL enforce the following migrated contract section. Accepted ADR decisions are binding; uppercase requirement keywords retain their BCP-14 meaning.
Result<T,E>SHALL be the canonical error-handling enum with variantsOk(T)andError(E).IsOk()andIsError()MUST report the active variant accurately, and all fallible corelib APIs MUST returnResult.
Stable ID: BSP-REQ-7A4C91E2F08B6D13
Scenario: Conformance exercises Decision
- GIVEN an implementation claims conformance with this capability
- WHEN behavior governed by this contract section is exercised
- THEN every MUST, SHALL, REQUIRED, prohibition, and accepted decision in the section is satisfied
Requirement: Result transformations and unwrapping: Decision [D-CORE-PRIM-0141]
The Beskid standard SHALL enforce the following migrated contract section. Accepted ADR decisions are binding; uppercase requirement keywords retain their BCP-14 meaning.
Unwrap()andUnwrapError()MUST panic when called on the opposite variant;UnwrapOr(default)SHALL return the contained value or the supplied default.MapandMapErrorSHALL transform the success or error value while preserving the other variant.
Stable ID: BSP-REQ-19D7A4C2E6F80B35
Scenario: Conformance exercises Decision
- GIVEN an implementation claims conformance with this capability
- WHEN behavior governed by this contract section is exercised
- THEN every MUST, SHALL, REQUIRED, prohibition, and accepted decision in the section is satisfied
Requirement: Prelude availability: Decision [D-CORE-PRIM-0142]
The Beskid standard SHALL enforce the following migrated contract section. Accepted ADR decisions are binding; uppercase requirement keywords retain their BCP-14 meaning.
The
Core.Resultsmodule MUST be@tier(standard)and MUST be available in the language prelude.
Stable ID: BSP-REQ-C53E8A17B942D6F0
Scenario: Conformance exercises Decision
- GIVEN an implementation claims conformance with this capability
- WHEN behavior governed by this contract section is exercised
- THEN every MUST, SHALL, REQUIRED, prohibition, and accepted decision in the section is satisfied