-
Notifications
You must be signed in to change notification settings - Fork 218
Open
Description
Feature Request
I have the situation where I need to do some stateful deserialization on a couple of columns because their names can only be known at runtime. The usual serde decorators aren't sufficient and I want to use Range::rows() and DeserializeSeed instead.
I'm having trouble because there doesn't seem to be a way to bridge &[Data] and my custom visit_seq.
// minimal example
let mut workbook: Xlsx<BufReader<File>> = open_workbook(&path).unwrap();
let range = workbook.worksheet_range("Sheet").unwrap();
let mut rows = range.rows();
let header_row = rows.next().unwrap();
let headers: HashMap<String, usize> = header_row
.iter()
.enumerate()
.map(|(idx, val)| (val.to_string(), idx))
.collect();
let seed = RowSeed {
headers: headers,
runtime_info: "something".into(),
};
let data_row = rows.next().unwrap();
/* what goes here? */
let row: RowStruct = seed.deserialize(/* and here? */).unwrap();Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels