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
pub struct Options {
pub header: bool,
pub align: bool,
pub standard: bool,
pub html3: bool,
pub expanded: bool,
pub pager: bool,
pub field_sep: String,
pub table_opt: String,
pub caption: String,
pub field_name: Vec<String>,
}
#[doc(hidden)]
impl Into<pq_sys::_PQprintOpt> for &Options {
fn into(self) -> pq_sys::_PQprintOpt {
let mut field_name = self
.field_name
.iter()
.map(|x| crate::cstr!(x) as *mut i8)
.collect::<Vec<_>>();
field_name.push(std::ptr::null_mut());
pq_sys::_PQprintOpt {
header: self.header as i8,
align: self.align as i8,
standard: self.standard as i8,
html3: self.html3 as i8,
expanded: self.expanded as i8,
pager: self.pager as i8,
fieldSep: crate::cstr!(&self.field_sep) as *mut i8,
tableOpt: crate::cstr!(&self.table_opt) as *mut i8,
caption: crate::cstr!(&self.caption) as *mut i8,
fieldName: field_name.as_mut_ptr(),
}
}
}