fn maybe_initialize<'a>() -> &'a mut CallbackMap {
        unsafe {
            // if this is our first time here since the Postgres backend started, XACT_HOOKS will be None
            if XACT_HOOKS.is_none() {
                // so lets swap it out with a new HashMap, which will live for the duration of the backend
                XACT_HOOKS.replace(HashMap::new());

                // and register our single callback function (internally defined above)
                pg_sys::RegisterXactCallback(Some(callback), std::ptr::null_mut());
            }

            XACT_HOOKS
                .as_mut()
                .expect("XACT_HOOKS was None during maybe_initialize") // this should never happen
        }
    }
// internal function to manage initialization of our transaction callback
internal function to manage initialization of our transaction callback
internal function to manage initialization of our transaction callback
fn maybe_initialize<'a>() -> &'a mut CallbackMap {
        unsafe {
            // if this is our first time here since the Postgres backend started, XACT_HOOKS will be None
            if XACT_HOOKS.is_none() {
                // so lets swap it out with a new HashMap, which will live for the duration of the backend
                XACT_HOOKS.replace(HashMap::new());
                // and register our single callback function (internally defined above)
                pg_sys::RegisterXactCallback(Some(callback), std::ptr::null_mut());
            }
            XACT_HOOKS
                .as_mut()
                .expect("XACT_HOOKS was None during maybe_initialize") // this should never happen
        }
    }
fn maybe_initialize < ' a > ( ) -> & ' a mut CallbackMap { unsafe { // if this is our first time here since the Postgres backend started, XACT_HOOKS will be None if XACT_HOOKS . is_none ( ) { // so lets swap it out with a new HashMap, which will live for the duration of the backend XACT_HOOKS . replace ( HashMap :: new ( ) ) ; // and register our single callback function (internally defined above) pg_sys :: RegisterXactCallback ( Some ( callback ) , std :: ptr :: null_mut ( ) ) ; } XACT_HOOKS . as_mut ( ) . expect ( " " ) // this should never happen } }
internal function to manage initialization of our transaction callback
internal function to manage initialization of our transaction callback