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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
// GENERATED CODE
//
// Generated from arry.x.
//
// DO NOT EDIT
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct foo {
pub blop: [i32; 2i64 as usize],
}
#[derive(Debug, Eq, PartialEq, Clone)]
pub enum u { Const0([i32; 2i64 as usize]), }
impl <Out: xdr_codec::Write> xdr_codec::Pack<Out> for foo {
fn pack(&self, out: &mut Out) -> xdr_codec::Result<usize> {
Ok(try!(xdr_codec:: pack_array ( & self . blop , out )) + 0)
}
}
impl <Out: xdr_codec::Write> xdr_codec::Pack<Out> for u {
#[inline]
fn pack(&self, out: &mut Out) -> xdr_codec::Result<usize> {
Ok(match self {
&u::Const0(ref val) =>
try!(0i64 . pack ( out )) +
try!(xdr_codec:: pack_array ( val , out )),
})
}
}
impl <In: xdr_codec::Read> xdr_codec::Unpack<In> for foo {
fn unpack(input: &mut In) -> xdr_codec::Result<(foo, usize)> {
let mut sz = 0;
Ok((foo{blop:
{
let (v, fsz) =
{
let mut asz = 0;
let v =
[{
let (v, esz) =
try!(xdr_codec:: Unpack:: unpack
( input ));
asz += esz;
v
},
{
let (v, esz) =
try!(xdr_codec:: Unpack:: unpack
( input ));
asz += esz;
v
}];
(v, asz)
};
sz += fsz;
v
},}, sz))
}
}
impl <In: xdr_codec::Read> xdr_codec::Unpack<In> for u {
#[inline]
fn unpack(input: &mut In) -> xdr_codec::Result<(u, usize)> {
let mut sz = 0;
Ok((match {
let (v, dsz) =
try!(xdr_codec:: Unpack:: unpack ( input ));
sz += dsz;
v
} {
0i32 =>
u::Const0({
let (v, csz) =
try!(xdr_codec:: Unpack:: unpack ( input ));
sz += csz;
v
}),
_ => return Err(xdr_codec::Error::invalidcase()),
}, sz))
}
}