Open gmosx opened 3 months ago
Well, one solution is to 'collect' the rows variable and eliminate the ref to the Statement:
let records = rows.map(|r| ...);
let records = records.collect::<Vec<....>>().unwrap();
But this prohibits using the column_count in the 'deserialization code'.
Actually you can use:
let col_count = rows.as_ref().unwrap().column_count();
I am wondering, how is the
column_count
method supposed to be used.AFAICU, you have to prepare and execute (query) the Statement, before you can call this method:
The problem is that the
query*
methods take a mutable reference to the Statement. When trying to call thecolumn_count
method, the borrow-checker complains:Please note that the error is only triggered if the rows variable is actually used!
I would like to use the column count when 'deserializing' the rows. Any help/hints will be appreciated.