Merge pull request #1788 from TheBlueMatt/2022-10-mtlc-writer

Add `WriteableScore` bindings impl for `MultiThreadedLockableScore`
This commit is contained in:
valentinewallace 2022-10-21 11:28:15 -04:00 committed by GitHub
commit fbacbc08b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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`].