Closed clouds56 closed 2 years ago
I was hoping that https://github.com/hobofan/ambassador/pull/33 would allow me to do delegation like the following (similar to above example)
#[derive(Debug)]
pub struct RwLockMockProductDaoImpl(tokio::sync::RwLock<MockProductDaoImpl>);
#[async_trait]
impl ProductDaoDelegate for RwLockMockProductDaoImpl {
async fn get_for_id(&self, id: i64) -> Result<Option<ProductModel>> {
let guard = self.0.read().await;
guard.get_for_id(id).await
}
}
However I am unable to work it out.
Is someone able to given an example of delegating to a new type that wraps a tokio::sync::RwLock
make things like work
or consider backward compatibility