pub struct Column<'a> { /* private fields */ }Expand description
Instance of a ESE database column in a currently open crate::Table.
Implementations§
Source§impl Column<'_>
impl Column<'_>
Sourcepub fn name(&self) -> Result<String>
pub fn name(&self) -> Result<String>
Gets the name of the column.
Examples found in repository?
examples/overview.rs (line 17)
3fn main() {
4 let filename = std::env::args()
5 .nth(1)
6 .expect("specify path to .esedb file");
7 let db = EseDb::open(&filename).unwrap();
8 println!("Database Overview ({}):", filename);
9 for table in db.iter_tables().unwrap() {
10 let table = table.unwrap();
11 println!(
12 " {} [{:?}]",
13 table.name().unwrap(),
14 table
15 .iter_columns()
16 .unwrap()
17 .map(|c| c.unwrap().name().unwrap())
18 .collect::<Vec<String>>()
19 .join(", "),
20 );
21 for record in table.iter_records().unwrap() {
22 let record = record.unwrap();
23 for i in 0..record.count_values().unwrap() {
24 println!(
25 " ├ T={:?} L={}, M={} V={:?}",
26 table.column(i).unwrap().variant().unwrap(),
27 record.is_long(i).unwrap(),
28 record.is_multi(i).unwrap(),
29 record.value(i).unwrap(),
30 );
31 }
32 }
33 }
34}Sourcepub fn variant(&self) -> Result<Value>
pub fn variant(&self) -> Result<Value>
Gets an empty Value representing the type of the data stored in the column.
Examples found in repository?
examples/overview.rs (line 26)
3fn main() {
4 let filename = std::env::args()
5 .nth(1)
6 .expect("specify path to .esedb file");
7 let db = EseDb::open(&filename).unwrap();
8 println!("Database Overview ({}):", filename);
9 for table in db.iter_tables().unwrap() {
10 let table = table.unwrap();
11 println!(
12 " {} [{:?}]",
13 table.name().unwrap(),
14 table
15 .iter_columns()
16 .unwrap()
17 .map(|c| c.unwrap().name().unwrap())
18 .collect::<Vec<String>>()
19 .join(", "),
20 );
21 for record in table.iter_records().unwrap() {
22 let record = record.unwrap();
23 for i in 0..record.count_values().unwrap() {
24 println!(
25 " ├ T={:?} L={}, M={} V={:?}",
26 table.column(i).unwrap().variant().unwrap(),
27 record.is_long(i).unwrap(),
28 record.is_multi(i).unwrap(),
29 record.value(i).unwrap(),
30 );
31 }
32 }
33 }
34}Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Column<'a>
impl<'a> RefUnwindSafe for Column<'a>
impl<'a> !Send for Column<'a>
impl<'a> !Sync for Column<'a>
impl<'a> Unpin for Column<'a>
impl<'a> UnwindSafe for Column<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more