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;
21#[path = "serde/mod.rs"]
22mod serde_impl;
23pub mod serde {
24 pub use super::serde_impl::*;
25}
26pub mod util;
27
28// Re-export main types from lang module
29pub use lang::{
30 argument::{
31 ArgumentError,
32 ArgumentResult,
33 CollectionArgument,
34 NumericArgument,
35 OptionArgument,
36 // String functions
37 StringArgument,
38 // Core functions
39 check_argument,
40 // Condition functions
41 check_argument_fmt,
42 check_argument_with_message,
43 check_bounds,
44 check_element_index,
45 check_position_index,
46 check_position_indexes,
47 check_state,
48 check_state_with_message,
49 // Collection functions
50 require_element_non_null,
51 // Numeric functions
52 require_equal,
53 require_not_equal,
54 // Option functions
55 require_null_or,
56 },
57 box_error::{
58 BoxError,
59 BoxResult,
60 },
61 data_type::{
62 DataType,
63 DataTypeOf,
64 },
65};
66
67// Re-export utility types
68pub use util::{
69 Pair,
70 Triple,
71};