mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-03-15 15:39:09 +01:00
Add WriteableScore
bindings impl for MultiThreadedLockableScore
In 56b07e52aa
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.
This commit is contained in:
parent
d6321e6e11
commit
6ec9b5357f
1 changed files with 10 additions and 0 deletions
|
@ -225,6 +225,16 @@ impl<'a, T: Score + 'a> LockableScore<'a> for MultiThreadedLockableScore<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(c_bindings)]
|
||||
impl<T: Score> Writeable for MultiThreadedLockableScore<T> {
|
||||
fn write<W: Writer>(&self, writer: &mut W) -> Result<(), io::Error> {
|
||||
self.lock().write(writer)
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(c_bindings)]
|
||||
impl<'a, T: Score + 'a> WriteableScore<'a> for MultiThreadedLockableScore<T> {}
|
||||
|
||||
#[cfg(c_bindings)]
|
||||
impl<T: Score> MultiThreadedLockableScore<T> {
|
||||
/// Creates a new [`MultiThreadedLockableScore`] given an underlying [`Score`].
|
||||
|
|
Loading…
Add table
Reference in a new issue