1
2#[cfg(any(feature = "appliers", feature = "var-dims"))]
3use arrayvec::ArrayVec;
4
5#[cfg(any(feature = "appliers", feature = "var-dims"))]
12pub(crate) fn arrvec_into_inner<T, const N: usize>(arrvec: ArrayVec<T, N>, method_name: &str) -> [T; N] {
13 match arrvec.into_inner() {
14 Ok(arr) => arr,
15 _ => panic!(
16 "Couldn't convert ArrayVec into array in {}() method. \
17 This operation should never have panicked. Please contact \
18 the maintainers of PointND if troubles persist",
19 method_name
20 )
21 }
22}
23
24#[cfg(any(feature = "appliers", feature = "var-dims"))]
25pub const ARRVEC_CAP: usize = u32::MAX as usize;
26
27#[cfg(feature = "appliers")]
29pub type ApplyFn<T, U> = fn(T) -> U;
30
31#[cfg(feature = "appliers")]
33pub type ApplyDimsFn<T> = fn(T) -> T;
34
35#[cfg(feature = "appliers")]
41pub type ApplyValsFn<T, U, V> = fn(T, V) -> U;
42
43#[cfg(feature = "appliers")]
49pub type ApplyPointFn<T, U, V> = ApplyValsFn<T, U, V>;
50
51