Add a `MutexGuard` wrapper for the bindings-only `LockableScore`
authorMatt Corallo <git@bluematt.me>
Mon, 19 Sep 2022 09:11:11 +0000 (09:11 +0000)
committerMatt Corallo <git@bluematt.me>
Fri, 23 Sep 2022 08:17:40 +0000 (08:17 +0000)
commit2cc9a4d6ac0a078448340a03d1700aae7690b265
tree00b3a502b1796661e0b7f714a19e99936d123be7
parent4c5a01503aeb63e1d1d6bade89d6baab65840263
Add a `MutexGuard` wrapper for the bindings-only `LockableScore`

In the bindings, we don't directly export any `std` types. Instead,
we provide trivial wrappers around them which expose only a
bindings-compatible API (and which is code in-crate, where the
bindings generator can see it).

We never quite finished this for `MultiThreadedLockableScore` - due
to some limitations in the bindings generator and the way the
scores are used in `lightning-invoice`, the scoring API ended up
being further concretized in patches for the bindings. Luckily the
scoring interface has been rewritten somewhat, and it so happens
that we can now generate bindings with the upstream code.

The final piece of the puzzle is done here, where we add a struct
which wraps `MutexGuard` so that we can expose the lock for
`MultiThreadedLockableScore`.
lightning/src/routing/scoring.rs