prism3_function/
lib.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2025.
4 *    3-Prism Co. Ltd.
5 *
6 *    All rights reserved.
7 *
8 ******************************************************************************/
9//! # Prism3 Function
10//!
11//! Provides functional programming abstractions for Rust, including:
12//!
13//! - **Transformer types**: Transform values from type T to type R
14//! - **UnaryOperator types**: Transform values of type T to the same type T
15//! - **BiTransformer types**: Transform two values to produce a result
16//! - **BinaryOperator types**: Transform two values of type T to produce a T
17//! - **Consumer types**: Functions that consume values without returning
18//! - **BiConsumer types**: Functions that consume two values without returning
19//! - **Predicate types**: Functions that test values and return boolean
20//! - **BiPredicate types**: Functions that test two values and return boolean
21//! - **Supplier types**: Functions that produce values without input
22//! - **Mapper types**: Stateful transformations from type T to type R
23//! - **Tester types**: Functions that test conditions without input
24//! - **Comparator types**: Functions that compare values and return ordering
25//!
26//! # Author
27//!
28//! Haixing Hu
29
30pub mod bi_consumer;
31pub mod bi_consumer_once;
32pub mod bi_predicate;
33pub mod bi_transformer;
34pub mod bi_transformer_once;
35pub mod comparator;
36pub mod consumer;
37pub mod consumer_once;
38pub mod mapper;
39pub mod mapper_once;
40pub mod mutator;
41pub mod mutator_once;
42pub mod predicate;
43pub mod readonly_bi_consumer;
44pub mod readonly_consumer;
45pub mod readonly_supplier;
46pub mod supplier;
47pub mod supplier_once;
48pub mod tester;
49pub mod transformer;
50pub mod transformer_once;
51
52pub use bi_consumer::{ArcBiConsumer, BiConsumer, BoxBiConsumer, FnBiConsumerOps, RcBiConsumer};
53pub use bi_consumer_once::{BiConsumerOnce, BoxBiConsumerOnce, FnBiConsumerOnceOps};
54pub use bi_predicate::{
55    ArcBiPredicate, BiPredicate, BoxBiPredicate, FnBiPredicateOps, RcBiPredicate,
56};
57pub use bi_transformer::{
58    ArcBiTransformer, ArcBinaryOperator, BiTransformer, BinaryOperator, BoxBiTransformer,
59    BoxBinaryOperator, FnBiTransformerOps, RcBiTransformer, RcBinaryOperator,
60};
61pub use bi_transformer_once::{
62    BiTransformerOnce, BinaryOperatorOnce, BoxBiTransformerOnce, BoxBinaryOperatorOnce,
63    FnBiTransformerOnceOps,
64};
65pub use comparator::{ArcComparator, BoxComparator, Comparator, FnComparatorOps, RcComparator};
66pub use consumer::{ArcConsumer, BoxConsumer, Consumer, FnConsumerOps, RcConsumer};
67pub use consumer_once::{BoxConsumerOnce, ConsumerOnce, FnConsumerOnceOps};
68pub use mapper::{
69    ArcConditionalMapper, ArcMapper, BoxConditionalMapper, BoxMapper, FnMapperOps, Mapper,
70    RcConditionalMapper, RcMapper,
71};
72pub use mapper_once::{BoxConditionalMapperOnce, BoxMapperOnce, FnMapperOnceOps, MapperOnce};
73pub use mutator::{
74    ArcConditionalMutator, ArcMutator, BoxConditionalMutator, BoxMutator, FnMutatorOps, Mutator,
75    RcConditionalMutator, RcMutator,
76};
77pub use mutator_once::{BoxConditionalMutatorOnce, BoxMutatorOnce, FnMutatorOnceOps, MutatorOnce};
78pub use predicate::{ArcPredicate, BoxPredicate, FnPredicateOps, Predicate, RcPredicate};
79pub use readonly_bi_consumer::{
80    ArcReadonlyBiConsumer, BoxReadonlyBiConsumer, FnReadonlyBiConsumerOps, RcReadonlyBiConsumer,
81    ReadonlyBiConsumer,
82};
83pub use readonly_consumer::{
84    ArcReadonlyConsumer, BoxReadonlyConsumer, FnReadonlyConsumerOps, RcReadonlyConsumer,
85    ReadonlyConsumer,
86};
87pub use readonly_supplier::{
88    ArcReadonlySupplier, BoxReadonlySupplier, RcReadonlySupplier, ReadonlySupplier,
89};
90pub use supplier::{ArcSupplier, BoxSupplier, FnSupplierOps, RcSupplier, Supplier};
91pub use supplier_once::{BoxSupplierOnce, SupplierOnce};
92pub use tester::{ArcTester, BoxTester, FnTesterOps, RcTester, Tester};
93pub use transformer::{
94    ArcConditionalTransformer, ArcTransformer, ArcUnaryOperator, BoxConditionalTransformer,
95    BoxTransformer, BoxUnaryOperator, FnTransformerOps, RcConditionalTransformer, RcTransformer,
96    RcUnaryOperator, Transformer, UnaryOperator,
97};
98pub use transformer_once::{
99    BoxConditionalTransformerOnce, BoxTransformerOnce, BoxUnaryOperatorOnce, FnTransformerOnceOps,
100    TransformerOnce, UnaryOperatorOnce,
101};