vax-r commented on issue #1873:
URL: https://github.com/apache/iggy/issues/1873#issuecomment-2992093268

   What about chosen between trait bound and `derive` attribute ?
   
   E.g. refactoring `IggyStreamProducer` to `IggyStreamProducer<T> where T: 
Client + Default + ... `
   
   Since it has `#[derive(Debug, Default, Clone, Eq, PartialEq)]` , the 
compiler will complain something like
   ```
   error[E0283]: type annotations needed
     --> core/sdk/src/stream_builder/iggy_stream_producer.rs:26:17
      |
   26 | #[derive(Debug, Default, Clone, Eq, PartialEq)]
      |                 ^ cannot infer type
   ```
   
   Removing `Clone` and `Default` in `derive` will get through the compiler ( 
not sure about run-time yet ).
   I'm not familiar with the difference between them, I would love to know what 
do you suggest here ?
   
   Btw, we expect users to put `HttpClient, QuicClient, TcpClient` in `T` when 
actually using it. Do we have to enforce the same trait bound across all 
structs/trait that uses this `T` ?
   


-- 
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]

Reply via email to