Skip to main content

qubit_common/
lib.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025 - 2026.
4 *    Haixing Hu, Qubit Co. Ltd.
5 *
6 *    All rights reserved.
7 *
8 ******************************************************************************/
9//! # Qubit Common - Core Utility Library
10//!
11//! Provides language-level fundamental tools and data type support, including:
12//! - Data type definitions and validation
13//! - Argument validation and error handling
14//! - Core utility functions
15//!
16//! # Author
17//!
18//! Haixing Hu
19
20pub mod lang;
21pub mod util;
22
23// Re-export main types from lang module
24pub use lang::{
25    argument::{
26        ArgumentError,
27        ArgumentResult,
28        CollectionArgument,
29        NumericArgument,
30        OptionArgument,
31        // String functions
32        StringArgument,
33        // Core functions
34        check_argument,
35        // Condition functions
36        check_argument_fmt,
37        check_argument_with_message,
38        check_bounds,
39        check_element_index,
40        check_position_index,
41        check_position_indexes,
42        check_state,
43        check_state_with_message,
44        // Collection functions
45        require_element_non_null,
46        // Numeric functions
47        require_equal,
48        require_not_equal,
49        // Option functions
50        require_null_or,
51    },
52    box_error::{
53        BoxError,
54        BoxResult,
55    },
56    data_type::{
57        DataType,
58        DataTypeOf,
59    },
60};
61
62// Re-export utility types
63pub use util::{
64    Pair,
65    Triple,
66};