src/bisection_tree/either.rs

branch
dev
changeset 86
d5b0e496b72f
parent 59
9226980e45a7
equal deleted inserted replaced
76:99ad55974e62 86:d5b0e496b72f
1 1
2 use std::iter::Chain; 2 use std::iter::Chain;
3 use std::sync::Arc; 3 use std::sync::Arc;
4 use serde::{Serialize, Deserialize};
4 5
5 use crate::types::*; 6 use crate::types::*;
6 use crate::mapping::{ 7 use crate::mapping::{
7 Instance, 8 Instance,
8 Mapping, 9 Mapping,
18 use super::aggregator::*; 19 use super::aggregator::*;
19 20
20 /// A structure for storing two [`SupportGenerator`]s summed/chain together. 21 /// A structure for storing two [`SupportGenerator`]s summed/chain together.
21 /// 22 ///
22 /// This is needed to work with sums of different types of [`Support`]s. 23 /// This is needed to work with sums of different types of [`Support`]s.
23 #[derive(Debug,Clone)] 24 #[derive(Debug,Clone,Serialize,Deserialize)]
24 pub struct BothGenerators<A, B>( 25 pub struct BothGenerators<A, B>(
25 pub(super) Arc<A>, 26 pub(super) Arc<A>,
26 pub(super) Arc<B>, 27 pub(super) Arc<B>,
27 ); 28 );
28 29
29 /// A structure for a [`Support`] that can be either `A` or `B`. 30 /// A structure for a [`Support`] that can be either `A` or `B`.
30 /// 31 ///
31 /// This is needed to work with sums of different types of [`Support`]s. 32 /// This is needed to work with sums of different types of [`Support`]s.
32 #[derive(Debug,Clone)] 33 #[derive(Debug,Clone,Serialize,Deserialize)]
33 pub enum EitherSupport<A, B> { 34 pub enum EitherSupport<A, B> {
34 Left(A), 35 Left(A),
35 Right(B), 36 Right(B),
36 } 37 }
37 38

mercurial