1use std::ops::{Index, Range};
2
3use arrayvec::ArrayVec;
4
5pub trait SSS: Send + Sync + 'static {}
8impl<T: Send + Sync + 'static> SSS for T {}
9
10pub trait Selection: Send + 'static {}
13impl<T: Send + 'static> Selection for T {}
14pub type Identifier<T, S> = fn(&T) -> (u32, S);
15
16pub trait SegmentableItem: SSS + Index<Range<usize>, Output = str> {}
17impl<T: SSS + Index<Range<usize>, Output = str>> SegmentableItem for T {}
18
19pub const MAX_SPLITS: usize = 10;
24pub type RenderFn<T> = Box<dyn for<'a> Fn(&'a T, &'a str) -> String + Send + Sync>;
25pub type SplitterFn<T> = std::sync::Arc<dyn for<'a> Fn(&'a T) -> ArrayVec<(usize, usize), MAX_SPLITS> + Send + Sync>;
26
27pub const MAX_ACTIONS: usize = 6;
28pub const MAX_EFFECTS: usize = 12;