Requirements#

Result Library Requirements
status: draft
safety: ASIL_B
tags: requirements, result_library

Functional Requirements#

Result-Based Error Handling
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The Result library shall provide an error handling mechanism that enables functions to return either successful values or error information without using C++ exceptions.

Domain-Specific Error Information
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The Result library shall support user-defined error domains and error codes.

Type-Safe Error Handling
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The Result library shall enforce compile-time type safety for error handling operations.

Standard Library Integration
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The Result library shall provide conversion utilities to transform Result objects into standard library optional type, with enforced error handling.

Non-Functional Requirements#

Deterministic Behavior
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Non-Functional

The Result library shall provide deterministic behavior with no dynamic memory allocation.

Exception-Free Operation
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Non-Functional

The Result library shall operate without throwing C++ exceptions.

Assumptions of Use (AoU)#

Error Domain Implementation
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The user shall implement error domain classes and error code enumerations according to the library’s interface specification.

Result Value Handling
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Functional

The user shall check and handle both successful and error states of Result objects before accessing contained values to prevent undefined behavior.

Thread Safety
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Non-Functional

The user shall ensure appropriate synchronization mechanisms when using Result objects in multi-threaded environments, as the library provides no internal thread safety guarantees.

Resource Lifetime
status: valid
security: NO
safety: ASIL_B
tags: inspected, baselibs, result_library
reqtype: Non-Functional

The user shall ensure that error domain objects and referenced resources remain valid throughout the entire lifetime of any dependent Result or Error objects.