1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
use field_traits::*;
use prelude::*;
use crate_::ops::{Map_};
pub trait InitializationValues {
type Uninitialized;
type Initialized;
}
pub trait Construct_<FVPairs>: InitializationValues {
type Output;
}
pub type Construct<Type, FVPairs> = <Type as Construct_<FVPairs>>::Output;
pub struct IsInitField<FieldAccessor>(FieldAccessor);
pub struct UninitField<FieldAccessor>(FieldAccessor);
impl<Type, FVPairs, Out> Construct_<FVPairs> for Type
where
Self: InitializationValues,
ConstructFn: TypeFn_<(Type, FVPairs), Output = Out>,
{
type Output = Out;
}
type_fn!{
pub fn ConstructFn[Type,FVPairs](Type,FVPairs)
where [
Type:InitializationValues,
FVPairs:Map_< SetInitialized ,Output=InitFVPairs>,
SetFieldsOp:TypeFn_<(Type::Uninitialized,FVPairs),Output=Out>,
SetFieldsOp:TypeFn_<(Type::Uninitialized,InitFVPairs),Output=InitOut>,
InitOut:TypeIdentity<Type= Type::Initialized >,
]{
let InitFVPairs;
let Out;
let InitOut;
Out
}
}
type_fn!{
#[doc(hidden)]
pub fn SetInitialized[Field,Value]((Field,Value))
{ (Field,IsInitField<Field>) }
}