arr_rs/lib.rs
1//! arr-rs - implementation of multidimensional array in Rust
2//! # Examples
3//!
4//! ```ignore
5//! // import the crate
6//! use arr_rs::prelude::*;
7//!
8//! // create an array: (4 elements, 2 dimensions)
9//! let arr = Array::<i32>::new(vec![1, 2, 3, 4], vec![2, 2]);
10//!
11//! // create same array using macro:
12//! let arr: Array::<i32> = array!([[1, 2], [3, 4]]);
13//!
14//! // create random array with the same shape:
15//! let arr = Array::<i32>::rand(vec![2, 2]);
16//!
17//! // array supports display and pretty display
18//! let arr: Array<f64> = array!([[1, 2, 3], [4, 5, 6], [7, 8, 9]]);
19//! println!("{array}");
20//! println!("{array:#}");
21//!
22//! // perform some chained operations on array:
23//! let res = arr
24//! .map(|item| item * 2)
25//! .filter(|item| item % 3 == 0)
26//! .ravel()
27//! .slice(0..2);
28//! ```
29//!
30//! # Crate Features
31//! - `macros` - create array macro (enabled by default)
32//!
33
34#![forbid(unsafe_code)]
35#![deny(clippy::all)]
36#![deny(clippy::cargo)]
37#![deny(clippy::complexity)]
38#![deny(clippy::correctness)]
39#![deny(clippy::nursery)]
40#![deny(clippy::pedantic)]
41#![deny(clippy::perf)]
42#![deny(clippy::style)]
43#![deny(clippy::suspicious)]
44#![deny(missing_docs)]
45#![deny(missing_debug_implementations)]
46#![allow(clippy::module_name_repetitions)]
47#![allow(clippy::redundant_pub_crate)]
48#![allow(clippy::similar_names)]
49#![cfg_attr(test, deny(rust_2018_idioms))]
50
51/// core functionality - common for modules
52pub mod core;
53
54/// alphanumeric module implementation
55#[cfg(feature = "alphanumeric")]
56pub mod alphanumeric;
57
58/// boolean module implementation
59#[cfg(feature = "boolean")]
60pub mod boolean;
61
62/// linear algebra module implementation
63#[cfg(feature = "linalg")]
64pub mod linalg;
65
66/// math module implementation
67#[cfg(feature = "math")]
68pub mod math;
69
70/// numeric module implementation
71#[cfg(feature = "numeric")]
72pub mod numeric;
73
74/// array error definitions
75pub mod errors;
76
77/// create array macro implementation
78#[cfg(feature = "macros")]
79pub mod macros;
80
81/// prelude module - imports facade
82pub mod prelude;
83
84/// extension functions
85pub(crate) mod extensions;
86
87/// array validators definitions
88pub(crate) mod validators;