• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

YACLib / YACLib / 27293293670
99%

Build:
DEFAULT BRANCH: main
Ran 10 Jun 2026 05:40PM UTC
Jobs 1
Files 88
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

10 Jun 2026 05:18PM UTC coverage: 99.434% (-0.6%) from 100.0%
27293293670

push

github

web-flow
Trait-based error handling for all abstractions (#276)

Supersedes #258 (same idea, rebuilt on current main: SharedFuture,
UniqueCore/SharedCore split and the reworked combinators are covered).

### Purpose

Refactor yaclib's core primitives to support custom result types
natively. Instead of the hardcoded `std::variant`-based `Result<V, E>`,
every abstraction (`Future`, `Promise`, `Task`, `SharedFuture`,
combinators, coroutines) takes a **result trait** `T` (default
`DefaultTrait`) that defines the result container and error handling —
making yaclib interoperable with `std::expected`/`absl::StatusOr`-style
types with zero overhead and zero wrappers.

### Key changes

- `Future<V, E = StopError>` → `Future<V, T = DefaultTrait>` everywhere.
- New default `Result<V>`: `exception_ptr` + value union, single error
channel. `sizeof(Result<void>) == sizeof(std::exception_ptr)` (8 bytes,
was 16) where `no_unique_address` is supported.
- Cancellation is a cached `StopException` `exception_ptr`
(`StopPtr()`/`IsStop()`): no allocation per cancellation, no extra
atomics on the value path.
- `StopError`/`ResultError`/`ResultState` removed: the
Exception-vs-Error split unifies into one channel. **Behavior change**:
`[](std::exception_ptr)` recovery callbacks now also fire on
cancellation — use `yaclib::IsStop()` to distinguish.
- Trait interface (see `ResultTrait` docs in
`<yaclib/util/result.hpp>`): `Result<V>`/`Error` aliases, `MakeResult`,
`Ok`, `GetValue`/`GetError` (value-category-preserving accessors), `Get`
(value-or-throw, used by coroutine awaiters — containers need no
yaclib-specific members), `IsStop` (stop inspection in the trait's own
error vocabulary).

### yaclib_ext

New `include/yaclib_ext/` for integrations that require specific
libraries or standards, proving the flexibility claim with **raw**
vocabulary types:

- `yaclib_ext/std/expected.hpp` — `ExpectedTrait<E>`: `std::expected<V,
E>` as the container (C++23, including native `expected<void, E>... (continued)

296 of 296 new or added lines in 32 files covered. (100.0%)

6 existing lines in 3 files now uncovered.

2110 of 2122 relevant lines covered (99.43%)

1857961.08 hits per line

Coverage Regressions

Lines Coverage ∆ File
3
62.5
-37.5% include/yaclib/util/ref.hpp
2
93.55
-6.45% include/yaclib/algo/detail/shared_event.hpp
1
97.62
-2.38% include/yaclib/async/detail/wait_impl.hpp
Jobs
ID Job ID Ran Files Coverage
1 27293293670.1 10 Jun 2026 05:40PM UTC 88
99.43
GitHub Action Run
Source Files on build 27293293670
  • Tree
  • List 88
  • Changed 22
  • Source Changed 0
  • Coverage Changed 22
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • ca2c3f1c on github
  • Prev Build on main (#20663626703)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc