mdnt_groups_support/
lib.rs1#![doc = include_str!("../README.md")]
2#![deny(rustdoc::broken_intra_doc_links)]
11#![deny(missing_debug_implementations)]
12#![deny(missing_docs)]
13
14pub trait DecomposeIn<Cell> {
17 fn cells(&self) -> impl IntoIterator<Item = Cell>;
19}
20
21impl<Cell> DecomposeIn<Cell> for u32 {
22 fn cells(&self) -> impl IntoIterator<Item = Cell> {
23 std::iter::empty()
24 }
25}
26
27impl<Cell, T: DecomposeIn<Cell>, E> DecomposeIn<Cell> for Result<T, E> {
28 fn cells(&self) -> impl IntoIterator<Item = Cell> {
29 self.iter().flat_map(|t| t.cells())
30 }
31}
32
33impl<Cell, T: DecomposeIn<Cell>> DecomposeIn<Cell> for Option<T> {
34 fn cells(&self) -> impl IntoIterator<Item = Cell> {
35 self.iter().flat_map(|t| t.cells())
36 }
37}
38
39impl<Cell, T: DecomposeIn<Cell>> DecomposeIn<Cell> for &[T] {
40 fn cells(&self) -> impl IntoIterator<Item = Cell> {
41 self.iter().flat_map(|t| t.cells())
42 }
43}
44
45impl<Cell, T: DecomposeIn<Cell>, const N: usize> DecomposeIn<Cell> for [T; N] {
46 fn cells(&self) -> impl IntoIterator<Item = Cell> {
47 self.iter().flat_map(|t| t.cells())
48 }
49}
50
51impl<Cell, T: DecomposeIn<Cell>> DecomposeIn<Cell> for Vec<T> {
52 fn cells(&self) -> impl IntoIterator<Item = Cell> {
53 self.iter().flat_map(|t| t.cells())
54 }
55}