vax-r commented on issue #1873: URL: https://github.com/apache/iggy/issues/1873#issuecomment-2992215432
> Sounds about right. > > - with_client can go > - IggyClientBuilder<your_type> is good. > > I'm a big fan of seperate impl blocks and use them all the time. > > Go for it. > […](#) After looking into it further, we'll encounter problems when using `from_connection_string()` when putting them in separate blocks. e.g. for the use cases of `build_iggy_client()` , it's expected that the caller to use generic type. Inside of it we also need to use generic type to call `from_connection_string()` rather than explicitly point it to `IggyClient<TcpClient>, IggyClient<QuicClient>..` in the function body. I don't think user would want us to implement `build_iggy_client_tcp(), build_iggy_client_quic()...` and so on , not to mention it will continue to split up in the caller. One way to get around this is to put `from_connection_string()` in a new trait and put it in the trait bound of `T` . Implement an empty block of that trait for `IggyClient<T>` . But this will make the code look nasty. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
