[#util-Expected-0b] = xref:util.adoc[util]::Expected :relfileprefix: ../ :mrdocs: The util::Expected class provides a standard way for low‐level functions to return either error values or result values. == Synopsis Declared in `<util/expected.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class T, class E> class Expected; ---- == Description It provides a smaller version of std::expected from C++23. Missing features can be added, if needed. == Member Functions [cols="1,4"] |=== | Name| Description | xref:util/Expected-0b/2constructor-05.adoc[`Expected`] [.small]#[constructor]# | Constructors | xref:util/Expected-0b/error-0af.adoc[`error`] | Access the stored error (undefined behavior if a value is held). | xref:util/Expected-0b/has_value.adoc[`has_value`] | Test whether a result value is held. | xref:util/Expected-0b/operator_star-04.adoc[`operator*`] | Access the result value without checking. | xref:util/Expected-0b/operator_ptr-046.adoc[`operator‐>`] | Access members of the result value. | xref:util/Expected-0b/swap.adoc[`swap`] | Swap contents with another Expected. | xref:util/Expected-0b/value-05.adoc[`value`] | Access the result value, throwing if an error is held. | xref:util/Expected-0b/value_or-0c.adoc[`value_or`] | Return the result value, or a fallback when an error is held. | xref:util/Expected-0b/2conversion.adoc[`operator bool`] | Test whether a result value is held. |=== == Specializations [cols="1"] |=== | Name | xref:util/Expected-05.adoc[`Expected<void, E>`] |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:FeeRateEstimationRef.adoc[`::FeeRateEstimationRef`] | Return the estimation carried by a fee rate estimate result: the successful estimation, or the error's zero‐value estimation. | xref:ParseKeyPathElement.adoc[`::ParseKeyPathElement`] | Parse a single key path element like "0", "0'", or "0h". Returns the derivation index and hardened status, or an error message. | xref:SignPSBTInput.adoc[`::SignPSBTInput`] | Signs a PSBTInput, verifying that all provided data matches what is being signed. | xref:wallet/ExportDescriptors.adoc[`::wallet::ExportDescriptors`] | Export the descriptors from a wallet so that they can be imported elsewhere |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#