Skip to main content

BusyHandlerCallback

Type Alias BusyHandlerCallback 

Source
pub type BusyHandlerCallback = Box<dyn Fn(i32) -> i32 + Send + Sync>;
Expand description

Type alias for busy handler callback function.

The callback receives:

  • count: The number of times the busy handler has been invoked for the same locking event

Returns:

  • 0 to stop retrying and return SQLITE_BUSY to the application.
  • Non-zero to retry the database access.

§Safety Notes (per SQLite spec)

  • The callback MUST NOT modify the database connection that invoked it.
  • The callback MUST NOT close the connection or any prepared statement.
  • The callback is NOT reentrant.

Aliased Type§

pub struct BusyHandlerCallback(/* private fields */);