Skip to content

Commit 6ec9b53

Browse files
committed
Add WriteableScore bindings impl for MultiThreadedLockableScore
In 56b07e5 we made `MultiThreadedLockableScore` fully bindings-compatible. However, it did not add a `WriteableScore` implementation for it. This was an oversight as it is a `WriteableScore` in Rust and needs to be for use in other parts of the API. Here we add the required impl in a way that the bindings generator is able to handle it and add conversion utilities.
1 parent d6321e6 commit 6ec9b53

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

lightning/src/routing/scoring.rs

+10
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,16 @@ impl<'a, T: Score + 'a> LockableScore<'a> for MultiThreadedLockableScore<T> {
225225
}
226226
}
227227

228+
#[cfg(c_bindings)]
229+
impl<T: Score> Writeable for MultiThreadedLockableScore<T> {
230+
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
231+
self.lock().write(writer)
232+
}
233+
}
234+
235+
#[cfg(c_bindings)]
236+
impl<'a, T: Score + 'a> WriteableScore<'a> for MultiThreadedLockableScore<T> {}
237+
228238
#[cfg(c_bindings)]
229239
impl<T: Score> MultiThreadedLockableScore<T> {
230240
/// Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].

0 commit comments

Comments
 (0)