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//! - **Tester types**: Functions that test conditions without input
23//! - **Comparator types**: Functions that compare values and return ordering
24//!
25//! # Author
26//!
27//! Haixing Hu
28
29pub mod bi_consumer;
30pub mod bi_consumer_once;
31pub mod bi_predicate;
32pub mod bi_transformer;
33pub mod bi_transformer_once;
34pub mod comparator;
35pub mod consumer;
36pub mod consumer_once;
37pub mod mutator;
38pub mod mutator_once;
39pub mod predicate;
40pub mod readonly_bi_consumer;
41pub mod readonly_consumer;
42pub mod supplier;
43pub mod supplier_once;
44pub mod tester;
45pub mod transformer;
46pub mod transformer_once;
47
48pub use bi_consumer::{ArcBiConsumer, BiConsumer, BoxBiConsumer, FnBiConsumerOps, RcBiConsumer};
49pub use bi_consumer_once::{BiConsumerOnce, BoxBiConsumerOnce, FnBiConsumerOnceOps};
50pub use bi_predicate::{
51    ArcBiPredicate, BiPredicate, BoxBiPredicate, FnBiPredicateOps, RcBiPredicate,
52};
53pub use bi_transformer::{
54    ArcBiTransformer, ArcBinaryOperator, BiTransformer, BinaryOperator, BoxBiTransformer,
55    BoxBinaryOperator, FnBiTransformerOps, RcBiTransformer, RcBinaryOperator,
56};
57pub use bi_transformer_once::{
58    BiTransformerOnce, BinaryOperatorOnce, BoxBiTransformerOnce, BoxBinaryOperatorOnce,
59    FnBiTransformerOnceOps,
60};
61pub use comparator::{ArcComparator, BoxComparator, Comparator, FnComparatorOps, RcComparator};
62pub use consumer::{ArcConsumer, BoxConsumer, Consumer, FnConsumerOps, RcConsumer};
63pub use consumer_once::{BoxConsumerOnce, ConsumerOnce, FnConsumerOnceOps};
64pub use mutator::{
65    ArcConditionalMutator, ArcMutator, BoxConditionalMutator, BoxMutator, FnMutatorOps, Mutator,
66    RcConditionalMutator, RcMutator,
67};
68pub use mutator_once::{BoxConditionalMutatorOnce, BoxMutatorOnce, FnMutatorOnceOps, MutatorOnce};
69pub use predicate::{ArcPredicate, BoxPredicate, FnPredicateOps, Predicate, RcPredicate};
70pub use readonly_bi_consumer::{
71    ArcReadonlyBiConsumer, BoxReadonlyBiConsumer, FnReadonlyBiConsumerOps, RcReadonlyBiConsumer,
72    ReadonlyBiConsumer,
73};
74pub use readonly_consumer::{
75    ArcReadonlyConsumer, BoxReadonlyConsumer, FnReadonlyConsumerOps, RcReadonlyConsumer,
76    ReadonlyConsumer,
77};
78pub use supplier::{ArcSupplier, BoxSupplier, RcSupplier, Supplier};
79pub use supplier_once::{BoxSupplierOnce, SupplierOnce};
80pub use tester::{ArcTester, BoxTester, FnTesterOps, RcTester, Tester};
81pub use transformer::{
82    ArcConditionalTransformer, ArcTransformer, ArcUnaryOperator, BoxConditionalTransformer,
83    BoxTransformer, BoxUnaryOperator, FnTransformerOps, RcConditionalTransformer, RcTransformer,
84    RcUnaryOperator, Transformer, UnaryOperator,
85};
86pub use transformer_once::{
87    BoxConditionalTransformerOnce, BoxTransformerOnce, BoxUnaryOperatorOnce, FnTransformerOnceOps,
88    TransformerOnce, UnaryOperatorOnce,
89};