Coverage Report

Created: 2026-10-07 13:27

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/tmp/bitcoin/src/util/expected.h
Line
Count
Source
1
// Copyright (c) The Bitcoin Core developers
2
// Distributed under the MIT software license, see the accompanying
3
// file COPYING or https://opensource.org/license/mit.
4
5
#ifndef BITCOIN_UTIL_EXPECTED_H
6
#define BITCOIN_UTIL_EXPECTED_H
7
8
#include <attributes.h>
9
#include <util/check.h>
10
11
#include <exception>
12
#include <utility>
13
#include <variant>
14
15
namespace util {
16
17
/// The util::Unexpected class represents an unexpected value stored in
18
/// util::Expected.
19
template <class E>
20
class Unexpected
21
{
22
public:
23
26.4k
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<CDBWrapper::ReadFailure>::Unexpected(CDBWrapper::ReadFailure)
Line
Count
Source
23
7
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<std::unique_ptr<int, std::default_delete<int>>>::Unexpected(std::unique_ptr<int, std::default_delete<int>>)
Line
Count
Source
23
4
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Unexpected(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
Line
Count
Source
23
107
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<FeeRateEstimationError>::Unexpected(FeeRateEstimationError)
Line
Count
Source
23
3.69k
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<wallet::WalletError>::Unexpected(wallet::WalletError)
Line
Count
Source
23
15
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<ThreadPool::SubmitError>::Unexpected(ThreadPool::SubmitError)
Line
Count
Source
23
8
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<int>::Unexpected(int)
Line
Count
Source
23
1
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<char const*>::Unexpected(char const*)
Line
Count
Source
23
24
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<node::ReadRawError>::Unexpected(node::ReadRawError)
Line
Count
Source
23
335
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<bip352::PrevoutsSummaryError>::Unexpected(bip352::PrevoutsSummaryError)
Line
Count
Source
23
3
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
util::Unexpected<common::PSBTError>::Unexpected(common::PSBTError)
Line
Count
Source
23
22.2k
    constexpr explicit Unexpected(E e) : m_error(std::move(e)) {}
24
25
1
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return m_error; }
26
2
    constexpr E& error() & noexcept LIFETIMEBOUND { return m_error; }
27
26.4k
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<CDBWrapper::ReadFailure>::error() &&
Line
Count
Source
27
7
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<ThreadPool::SubmitError>::error() &&
Line
Count
Source
27
8
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<int>::error() &&
Line
Count
Source
27
1
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<char const*>::error() &&
Line
Count
Source
27
24
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<std::unique_ptr<int, std::default_delete<int>>>::error() &&
Line
Count
Source
27
4
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() &&
Line
Count
Source
27
107
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<node::ReadRawError>::error() &&
Line
Count
Source
27
335
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<FeeRateEstimationError>::error() &&
Line
Count
Source
27
3.69k
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<wallet::WalletError>::error() &&
Line
Count
Source
27
15
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<bip352::PrevoutsSummaryError>::error() &&
Line
Count
Source
27
3
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
util::Unexpected<common::PSBTError>::error() &&
Line
Count
Source
27
22.2k
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(m_error); }
28
29
private:
30
    E m_error;
31
};
32
33
struct BadExpectedAccess : std::exception {
34
0
    const char* what() const noexcept override { return "Bad util::Expected access"; }
35
};
36
37
/// The util::Expected class provides a standard way for low-level functions to
38
/// return either error values or result values.
39
///
40
/// It provides a smaller version of std::expected from C++23. Missing features
41
/// can be added, if needed.
42
template <class T, class E>
43
class Expected
44
{
45
private:
46
    std::variant<T, E> m_data;
47
48
public:
49
1
    constexpr Expected() : m_data{std::in_place_index<0>, T{}} {}
50
5.83M
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<bool, CDBWrapper::ReadFailure>::Expected(bool)
Line
Count
Source
50
5.44M
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::future<void>, ThreadPool::SubmitError>::Expected(std::future<void>)
Line
Count
Source
50
185k
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::future<bool>, ThreadPool::SubmitError>::Expected(std::future<bool>)
Line
Count
Source
50
2
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::Expected(std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
Line
Count
Source
50
1
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::Expected(std::vector<std::future<void>, std::allocator<std::future<void>>>)
Line
Count
Source
50
9.53k
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::Expected(std::vector<std::future<int>, std::allocator<std::future<int>>>)
Line
Count
Source
50
2
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::Expected(util_expected_tests::expected_value::test_method()::Obj)
Line
Count
Source
50
1
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::unique_ptr<int, std::default_delete<int>>, int>::Expected(std::unique_ptr<int, std::default_delete<int>>)
Line
Count
Source
50
3
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<char const*, std::unique_ptr<int, std::default_delete<int>>>::Expected(char const*)
Line
Count
Source
50
1
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected(TxoSpender)
Line
Count
Source
50
21
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected(std::optional<TxoSpender>)
Line
Count
Source
50
36
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::Expected(std::vector<std::byte, std::allocator<std::byte>>)
Line
Count
Source
50
147k
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<FeeRateEstimation, FeeRateEstimationError>::Expected(FeeRateEstimation)
Line
Count
Source
50
9.64k
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<CExtPubKey, wallet::WalletError>::Expected(CExtPubKey)
Line
Count
Source
50
10
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected(std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>)
Line
Count
Source
50
272
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected(bip352::SilentPaymentsDestination)
Line
Count
Source
50
88
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::Expected(bip352::PrevoutsSummary)
Line
Count
Source
50
29
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected(KeyPathElement)
Line
Count
Source
50
33.6k
    constexpr Expected(T v) : m_data{std::in_place_index<0>, std::move(v)} {}
51
    template <class Err>
52
4.16k
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
4.16k
    {
54
4.16k
    }
util::Expected<bool, CDBWrapper::ReadFailure>::Expected<CDBWrapper::ReadFailure>(util::Unexpected<CDBWrapper::ReadFailure>)
Line
Count
Source
52
7
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
7
    {
54
7
    }
util::Expected<std::future<void>, ThreadPool::SubmitError>::Expected<ThreadPool::SubmitError>(util::Unexpected<ThreadPool::SubmitError>)
Line
Count
Source
52
5
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
5
    {
54
5
    }
Unexecuted instantiation: util::Expected<std::future<bool>, ThreadPool::SubmitError>::Expected<ThreadPool::SubmitError>(util::Unexpected<ThreadPool::SubmitError>)
Unexecuted instantiation: util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::Expected<ThreadPool::SubmitError>(util::Unexpected<ThreadPool::SubmitError>)
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::Expected<ThreadPool::SubmitError>(util::Unexpected<ThreadPool::SubmitError>)
Line
Count
Source
52
3
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
3
    {
54
3
    }
Unexecuted instantiation: util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::Expected<ThreadPool::SubmitError>(util::Unexpected<ThreadPool::SubmitError>)
util::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>::Expected<int>(util::Unexpected<int>)
Line
Count
Source
52
1
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
1
    {
54
1
    }
util::Expected<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<char const*>(util::Unexpected<char const*>)
Line
Count
Source
52
1
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
1
    {
54
1
    }
util::Expected<int, std::unique_ptr<int, std::default_delete<int>>>::Expected<std::unique_ptr<int, std::default_delete<int>>>(util::Unexpected<std::unique_ptr<int, std::default_delete<int>>>)
Line
Count
Source
52
1
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
1
    {
54
1
    }
util::Expected<char const*, std::unique_ptr<int, std::default_delete<int>>>::Expected<std::unique_ptr<int, std::default_delete<int>>>(util::Unexpected<std::unique_ptr<int, std::default_delete<int>>>)
Line
Count
Source
52
1
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
1
    {
54
1
    }
Unexecuted instantiation: util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<char const*>(util::Unexpected<char const*>)
Unexecuted instantiation: util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::Expected<node::ReadRawError>(util::Unexpected<node::ReadRawError>)
Line
Count
Source
52
335
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
335
    {
54
335
    }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::Expected<FeeRateEstimationError>(util::Unexpected<FeeRateEstimationError>)
Line
Count
Source
52
3.69k
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
3.69k
    {
54
3.69k
    }
util::Expected<CExtPubKey, wallet::WalletError>::Expected<wallet::WalletError>(util::Unexpected<wallet::WalletError>)
Line
Count
Source
52
3
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
3
    {
54
3
    }
Unexecuted instantiation: util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<char const*>(util::Unexpected<char const*>)
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<char const*>(util::Unexpected<char const*>)
Line
Count
Source
52
18
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
18
    {
54
18
    }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
Line
Count
Source
52
27
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
27
    {
54
27
    }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::Expected<bip352::PrevoutsSummaryError>(util::Unexpected<bip352::PrevoutsSummaryError>)
Line
Count
Source
52
3
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
3
    {
54
3
    }
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
Line
Count
Source
52
56
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
53
56
    {
54
56
    }
55
56
11.5M
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::has_value() const
Line
Count
Source
56
36.7k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<bool, CDBWrapper::ReadFailure>::has_value() const
Line
Count
Source
56
10.8M
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
2.63k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::has_value() const
Line
Count
Source
56
60
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::has_value() const
Line
Count
Source
56
294k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::future<void>, ThreadPool::SubmitError>::has_value() const
Line
Count
Source
56
185k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::has_value() const
Line
Count
Source
56
19.0k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::future<bool>, ThreadPool::SubmitError>::has_value() const
Line
Count
Source
56
4
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::has_value() const
Line
Count
Source
56
2
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::has_value() const
Line
Count
Source
56
4
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
82
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::has_value() const
Line
Count
Source
56
12
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::unique_ptr<int, std::default_delete<int>>, int>::has_value() const
Line
Count
Source
56
4
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
1
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<char const*, std::unique_ptr<int, std::default_delete<int>>>::has_value() const
Line
Count
Source
56
1
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>::has_value() const
Line
Count
Source
56
1
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<CExtPubKey, wallet::WalletError>::has_value() const
Line
Count
Source
56
24
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
63
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
558
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
56
100k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
57
5.62M
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::operator bool() const
Line
Count
Source
57
17.3k
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::operator bool() const
Line
Count
Source
57
147k
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<bool, CDBWrapper::ReadFailure>::operator bool() const
Line
Count
Source
57
5.42M
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::future<void>, ThreadPool::SubmitError>::operator bool() const
Line
Count
Source
57
367
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::operator bool() const
Line
Count
Source
57
9.53k
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::future<bool>, ThreadPool::SubmitError>::operator bool() const
Line
Count
Source
57
2
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::operator bool() const
Line
Count
Source
57
1
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::operator bool() const
Line
Count
Source
57
2
    constexpr explicit operator bool() const noexcept { return has_value(); }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::operator bool() const
Line
Count
Source
57
1
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<CExtPubKey, wallet::WalletError>::operator bool() const
Line
Count
Source
57
13
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator bool() const
Line
Count
Source
57
21
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator bool() const
Line
Count
Source
57
16
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator bool() const
Line
Count
Source
57
279
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator bool() const
Line
Count
Source
57
33.7k
    constexpr explicit operator bool() const noexcept { return has_value(); }
58
59
    constexpr const T& value() const& LIFETIMEBOUND
60
5.66M
    {
61
5.66M
        if (!has_value()) {
62
1
            throw BadExpectedAccess{};
63
1
        }
64
5.66M
        return std::get<0>(m_data);
65
5.66M
    }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::value() const &
Line
Count
Source
60
3.53k
    {
61
3.53k
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
3.53k
        return std::get<0>(m_data);
65
3.53k
    }
util::Expected<bool, CDBWrapper::ReadFailure>::value() const &
Line
Count
Source
60
5.44M
    {
61
5.44M
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
5.44M
        return std::get<0>(m_data);
65
5.44M
    }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::value() const &
Line
Count
Source
60
1
    {
61
1
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
1
        return std::get<0>(m_data);
65
1
    }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() const &
Line
Count
Source
60
46
    {
61
46
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
46
        return std::get<0>(m_data);
65
46
    }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::value() const &
Line
Count
Source
60
3
    {
61
3
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
3
        return std::get<0>(m_data);
65
3
    }
util::Expected<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() const &
Line
Count
Source
60
1
    {
61
1
        if (!has_value()) {
62
1
            throw BadExpectedAccess{};
63
1
        }
64
0
        return std::get<0>(m_data);
65
1
    }
Unexecuted instantiation: util::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, int>::value() const &
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() const &
Line
Count
Source
60
42
    {
61
42
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
42
        return std::get<0>(m_data);
65
42
    }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::value() const &
Line
Count
Source
60
144k
    {
61
144k
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
144k
        return std::get<0>(m_data);
65
144k
    }
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() const &
Line
Count
Source
60
66.6k
    {
61
66.6k
        if (!has_value()) {
62
0
            throw BadExpectedAccess{};
63
0
        }
64
66.6k
        return std::get<0>(m_data);
65
66.6k
    }
66
    constexpr T& value() & LIFETIMEBOUND
67
31.5k
    {
68
31.5k
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
31.5k
        return std::get<0>(m_data);
72
31.5k
    }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() &
Line
Count
Source
67
2.50k
    {
68
2.50k
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
2.50k
        return std::get<0>(m_data);
72
2.50k
    }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::value() &
Line
Count
Source
67
27
    {
68
27
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
27
        return std::get<0>(m_data);
72
27
    }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::value() &
Line
Count
Source
67
3.02k
    {
68
3.02k
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
3.02k
        return std::get<0>(m_data);
72
3.02k
    }
util::Expected<bool, CDBWrapper::ReadFailure>::value() &
Line
Count
Source
67
4
    {
68
4
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
4
        return std::get<0>(m_data);
72
4
    }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::value() &
Line
Count
Source
67
15.7k
    {
68
15.7k
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
15.7k
        return std::get<0>(m_data);
72
15.7k
    }
util::Expected<std::future<void>, ThreadPool::SubmitError>::value() &
Line
Count
Source
67
359
    {
68
359
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
359
        return std::get<0>(m_data);
72
359
    }
util::Expected<std::future<bool>, ThreadPool::SubmitError>::value() &
Line
Count
Source
67
2
    {
68
2
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
2
        return std::get<0>(m_data);
72
2
    }
util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::value() &
Line
Count
Source
67
1
    {
68
1
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
1
        return std::get<0>(m_data);
72
1
    }
util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::value() &
Line
Count
Source
67
2
    {
68
2
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
2
        return std::get<0>(m_data);
72
2
    }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() &
Line
Count
Source
67
10
    {
68
10
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
10
        return std::get<0>(m_data);
72
10
    }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::value() &
Line
Count
Source
67
7
    {
68
7
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
7
        return std::get<0>(m_data);
72
7
    }
util::Expected<std::unique_ptr<int, std::default_delete<int>>, int>::value() &
Line
Count
Source
67
3
    {
68
3
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
3
        return std::get<0>(m_data);
72
3
    }
util::Expected<char const*, std::unique_ptr<int, std::default_delete<int>>>::value() &
Line
Count
Source
67
1
    {
68
1
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
1
        return std::get<0>(m_data);
72
1
    }
util::Expected<CExtPubKey, wallet::WalletError>::value() &
Line
Count
Source
67
11
    {
68
11
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
11
        return std::get<0>(m_data);
72
11
    }
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() &
Line
Count
Source
67
279
    {
68
279
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
279
        return std::get<0>(m_data);
72
279
    }
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::value() &
Line
Count
Source
67
9.53k
    {
68
9.53k
        if (!has_value()) {
69
0
            throw BadExpectedAccess{};
70
0
        }
71
9.53k
        return std::get<0>(m_data);
72
9.53k
    }
73
15
    constexpr T&& value() && LIFETIMEBOUND { return std::move(value()); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::value() &&
Line
Count
Source
73
4
    constexpr T&& value() && LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::value() &&
Line
Count
Source
73
10
    constexpr T&& value() && LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::unique_ptr<int, std::default_delete<int>>, int>::value() &&
Line
Count
Source
73
1
    constexpr T&& value() && LIFETIMEBOUND { return std::move(value()); }
74
75
    template <class U>
76
    T value_or(U&& default_value) const&
77
1
    {
78
1
        return has_value() ? value() : std::forward<U>(default_value);
79
1
    }
80
    template <class U>
81
    T value_or(U&& default_value) &&
82
1
    {
83
1
        return has_value() ? std::move(value()) : std::forward<U>(default_value);
84
1
    }
85
86
1.71k
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::error() const &
Line
Count
Source
86
1.68k
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<bool, CDBWrapper::ReadFailure>::error() const &
Line
Count
Source
86
4
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::error() const &
Line
Count
Source
86
2
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
Unexecuted instantiation: util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() const &
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::error() const &
Line
Count
Source
86
12
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
Unexecuted instantiation: util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() const &
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() const &
Line
Count
Source
86
18
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
87
3.76k
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() &
Line
Count
Source
87
70
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::error() &
Line
Count
Source
87
14
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<bool, CDBWrapper::ReadFailure>::error() &
Line
Count
Source
87
6
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<std::future<void>, ThreadPool::SubmitError>::error() &
Line
Count
Source
87
5
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<int, std::unique_ptr<int, std::default_delete<int>>>::error() &
Line
Count
Source
87
1
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<char const*, std::unique_ptr<int, std::default_delete<int>>>::error() &
Line
Count
Source
87
1
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<CExtPubKey, wallet::WalletError>::error() &
Line
Count
Source
87
5
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::error() &
Line
Count
Source
87
3.66k
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
Unexecuted instantiation: util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() &
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::error() &
Line
Count
Source
87
1
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
88
1
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(error()); }
89
90
1
    constexpr void swap(Expected& other) noexcept { m_data.swap(other.m_data); }
91
92
21.5k
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator*() &
Line
Count
Source
92
2.41k
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::operator*() &
Line
Count
Source
92
27
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::operator*() &
Line
Count
Source
92
2
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<CExtPubKey, wallet::WalletError>::operator*() &
Line
Count
Source
92
9
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::operator*() &
Line
Count
Source
92
6.30k
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::operator*() &
Line
Count
Source
92
2.98k
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator*() &
Line
Count
Source
92
270
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
util::Expected<std::vector<std::future<void>, std::allocator<std::future<void>>>, ThreadPool::SubmitError>::operator*() &
Line
Count
Source
92
9.53k
    constexpr T& operator*() & noexcept LIFETIMEBOUND { return value(); }
93
145k
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::operator*() const &
Line
Count
Source
93
1.52k
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util::Expected<bip352::PrevoutsSummary, bip352::PrevoutsSummaryError>::operator*() const &
Line
Count
Source
93
1
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator*() const &
Line
Count
Source
93
20
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::operator*() const &
Line
Count
Source
93
1
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator*() const &
Line
Count
Source
93
21
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::operator*() const &
Line
Count
Source
93
144k
    constexpr const T& operator*() const& noexcept LIFETIMEBOUND { return value(); }
94
365
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::future<void>, ThreadPool::SubmitError>::operator*() &&
Line
Count
Source
94
359
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::future<bool>, ThreadPool::SubmitError>::operator*() &&
Line
Count
Source
94
2
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::future<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, ThreadPool::SubmitError>::operator*() &&
Line
Count
Source
94
1
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::vector<std::future<int>, std::allocator<std::future<int>>>, ThreadPool::SubmitError>::operator*() &&
Line
Count
Source
94
2
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
util::Expected<std::unique_ptr<int, std::default_delete<int>>, int>::operator*() &&
Line
Count
Source
94
1
    constexpr T&& operator*() && noexcept LIFETIMEBOUND { return std::move(value()); }
95
96
9.61k
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util::Expected<bip352::SilentPaymentsDestination, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator->()
Line
Count
Source
96
92
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util::Expected<std::vector<std::byte, std::allocator<std::byte>>, node::ReadRawError>::operator->()
Line
Count
Source
96
31
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::operator->()
Line
Count
Source
96
2
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util::Expected<CExtPubKey, wallet::WalletError>::operator->()
Line
Count
Source
96
2
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::operator->()
Line
Count
Source
96
9.47k
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
util::Expected<std::vector<wallet::WalletDescInfo, std::allocator<wallet::WalletDescInfo>>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator->()
Line
Count
Source
96
9
    constexpr T* operator->() noexcept LIFETIMEBOUND { return &value(); }
97
68.7k
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
util::Expected<FeeRateEstimation, FeeRateEstimationError>::operator->() const
Line
Count
Source
97
2.01k
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
util::Expected<std::optional<TxoSpender>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator->() const
Line
Count
Source
97
10
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
util_expected_tests.cpp:util::Expected<util_expected_tests::expected_value::test_method()::Obj, int>::operator->() const
Line
Count
Source
97
1
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
util::Expected<TxoSpender, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator->() const
Line
Count
Source
97
21
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
util::Expected<KeyPathElement, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator->() const
Line
Count
Source
97
66.6k
    constexpr const T* operator->() const noexcept LIFETIMEBOUND { return &value(); }
98
};
99
100
template <class E>
101
class Expected<void, E>
102
{
103
private:
104
    std::variant<std::monostate, E> m_data;
105
106
public:
107
6.89k
    constexpr Expected() : m_data{std::in_place_index<0>, std::monostate{}} {}
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected()
Line
Count
Source
107
2.81k
    constexpr Expected() : m_data{std::in_place_index<0>, std::monostate{}} {}
util::Expected<void, wallet::WalletError>::Expected()
Line
Count
Source
107
99
    constexpr Expected() : m_data{std::in_place_index<0>, std::monostate{}} {}
util::Expected<void, common::PSBTError>::Expected()
Line
Count
Source
107
3.98k
    constexpr Expected() : m_data{std::in_place_index<0>, std::monostate{}} {}
108
    template <class Err>
109
22.3k
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
22.3k
    {
111
22.3k
    }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<char const*>(util::Unexpected<char const*>)
Line
Count
Source
109
5
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
5
    {
111
5
    }
util::Expected<void, std::unique_ptr<int, std::default_delete<int>>>::Expected<std::unique_ptr<int, std::default_delete<int>>>(util::Unexpected<std::unique_ptr<int, std::default_delete<int>>>)
Line
Count
Source
109
1
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
1
    {
111
1
    }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::Expected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>(util::Unexpected<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>)
Line
Count
Source
109
24
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
24
    {
111
24
    }
util::Expected<void, wallet::WalletError>::Expected<wallet::WalletError>(util::Unexpected<wallet::WalletError>)
Line
Count
Source
109
12
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
12
    {
111
12
    }
util::Expected<void, common::PSBTError>::Expected<common::PSBTError>(util::Unexpected<common::PSBTError>)
Line
Count
Source
109
22.2k
    constexpr Expected(Unexpected<Err> u) : m_data{std::in_place_index<1>, std::move(u).error()}
110
22.2k
    {
111
22.2k
    }
112
113
29.2k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::has_value() const
Line
Count
Source
113
2.84k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<void, wallet::WalletError>::has_value() const
Line
Count
Source
113
111
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
util::Expected<void, common::PSBTError>::has_value() const
Line
Count
Source
113
26.2k
    constexpr bool has_value() const noexcept { return m_data.index() == 0; }
114
2.94k
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::operator bool() const
Line
Count
Source
114
2.83k
    constexpr explicit operator bool() const noexcept { return has_value(); }
util::Expected<void, wallet::WalletError>::operator bool() const
Line
Count
Source
114
111
    constexpr explicit operator bool() const noexcept { return has_value(); }
115
116
1
    constexpr void operator*() const noexcept { return value(); }
117
    constexpr void value() const
118
3
    {
119
3
        if (!has_value()) {
120
1
            throw BadExpectedAccess{};
121
1
        }
122
3
    }
123
124
22.2k
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() const &
Line
Count
Source
124
4
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, wallet::WalletError>::error() const &
Line
Count
Source
124
4
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, common::PSBTError>::error() const &
Line
Count
Source
124
22.2k
    constexpr const E& error() const& noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
125
42
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::error() &
Line
Count
Source
125
26
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, std::unique_ptr<int, std::default_delete<int>>>::error() &
Line
Count
Source
125
1
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
util::Expected<void, wallet::WalletError>::error() &
Line
Count
Source
125
15
    constexpr E& error() & noexcept LIFETIMEBOUND { return *Assert(std::get_if<1>(&m_data)); }
126
1
    constexpr E&& error() && noexcept LIFETIMEBOUND { return std::move(error()); }
127
};
128
129
} // namespace util
130
131
#endif // BITCOIN_UTIL_EXPECTED_H