-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
When implementing user code that needs to type a parameter that should be either a Doc or Author Client, it currently requires adding quic-rpc as a dependency. The following example shows the current situation:
use iroh_docs::rpc::client::authors::Client;
use iroh_docs::rpc::client::docs::Doc;
use iroh_docs::rpc::proto::{Request, Response};
use quic_rpc::transport::flume::FlumeConnector;
pub struct ApplicationClient {
// ... //
blobs: iroh_blobs::rpc::client::blobs::MemClient,
docs: iroh_docs::rpc::client::docs::MemClient,
}
impl ApplicationClient {
// ... //
fn authors(
&self,
) -> Client<FlumeConnector<Response, Request>> {
self.docs.authors()
}
async fn create_doc(
&self,
) -> anyhow::Result<Doc<FlumeConnector<Response, Request>>> {
self.docs.create().await
}
}Both the Doc and Blobs Clients have a special type declared to avoid having to make quic-rpc a hard dependency in user code. Could such types be created for both Doc and the Author Client?
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status