qubit_metadata/metadata_result.rs
1// =============================================================================
2// Copyright (c) 2025 - 2026 Haixing Hu.
3//
4// SPDX-License-Identifier: Apache-2.0
5//
6// Licensed under the Apache License, Version 2.0.
7// =============================================================================
8//! [`MetadataResult`] — result alias for explicit `Metadata` operations.
9
10use crate::metadata_error::MetadataError;
11
12/// Result type used by explicit `Metadata` operations that report failure
13/// reasons instead of collapsing them into `None`.
14///
15/// # Type Parameters
16///
17/// * `T` - Success value returned by the metadata operation.
18///
19/// # Examples
20///
21/// ```
22/// use qubit_metadata::MetadataResult;
23///
24/// let result: MetadataResult<&str> = Ok("ready");
25/// assert_eq!(result, Ok("ready"));
26/// ```
27pub type MetadataResult<T> = Result<T, MetadataError>;