/// Bridge between `RawAutoExtension` and `AutoExtension` /// /// # Safety /// * Opening a database from an auto-extension handler will lead to /// an endless recursion of the auto-handler triggering itself /// indirectly for each newly-opened database. /// * Results are undefined if the given db is closed by an auto-extension. /// * The list of auto-extensions should not be manipulated from an auto-extension. pubunsafefn init_auto_extension(
db: *mut ffi::sqlite3,
pz_err_msg: *mut *mut c_char,
ax: AutoExtension,
) -> c_int { let r = catch_unwind(|| { let c = Connection::from_handle(db);
c.and_then(ax)
})
.unwrap_or_else(|_| Err(Error::UnwindingPanic)); match r {
Err(e) => to_sqlite_error(&e, pz_err_msg),
_ => ffi::SQLITE_OK,
}
}
/// Register au auto-extension /// /// # Safety /// * Opening a database from an auto-extension handler will lead to /// an endless recursion of the auto-handler triggering itself /// indirectly for each newly-opened database. /// * Results are undefined if the given db is closed by an auto-extension. /// * The list of auto-extensions should not be manipulated from an auto-extension. pubunsafefn register_auto_extension(ax: RawAutoExtension) -> Result<()> {
check(ffi::sqlite3_auto_extension(Some(ax)))
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.