[−][src]Function serde_rusqlite::columns_from_statement
pub fn columns_from_statement(stmt: &Statement) -> Vec<String>
Returns column names of the statement the way from_row_with_columns()
method expects them
This function is needed because by default column_names()
returns Vec<&str>
which
ties it to the lifetime of the rusqlite::Statement
. This way we won't be able to run for example
.query_map()
because it mutably borrows rusqlite::Statement
and by that time it's already borrowed
for columns. So this function owns all column names to detach them from the lifetime of rusqlite::Statement
.