Add a `MutexGuard` wrapper for the bindings-only `LockableScore` 2022-09-lockablescore-bindings
authorMatt Corallo <git@bluematt.me>
Mon, 19 Sep 2022 09:11:11 +0000 (09:11 +0000)
committerMatt Corallo <git@bluematt.me>
Mon, 19 Sep 2022 09:21:56 +0000 (09:21 +0000)
commit56b07e52aabdaca521987e765f1fa864966a5d49
tree5c0cdb471a552a6c84d0b0535ab592a7c8fa2916
parentdc28f9bb88735152260c4c96ae23f98cef32c979
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