Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conflicting implicit trait implementations (kafka-protocol ByteBuf and bytes Buf) #107

Closed
phughk opened this issue Feb 4, 2025 · 5 comments

Comments

@phughk
Copy link
Contributor

phughk commented Feb 4, 2025

I got the following error.

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:48:17
     |
48   |         Ok((buf.try_get_u8()? != 0).into())
     |                 ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
48   |         Ok((Buf::try_get_u8(&mut buf)? != 0).into())
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
48   |         Ok((ByteBuf::try_get_u8(&mut buf)? != 0).into())
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:85:23
     |
85   |     Int8: i8 [put_i8, try_get_i8],
     |                       ^^^^^^^^^^ multiple `try_get_i8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1239:5
     |
1239 |     fn try_get_i8(&mut self) -> Result<i8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:81:5
     |
81   |     fn try_get_i8(&mut self) -> Result<i8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i8(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i8(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:86:26
     |
86   |     Int16: i16 [put_i16, try_get_i16],
     |                          ^^^^^^^^^^^ multiple `try_get_i16` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1362:5
     |
1362 |     fn try_get_i16(&mut self) -> Result<i16, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:89:5
     |
89   |     fn try_get_i16(&mut self) -> Result<i16, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:87:27
     |
87   |     UInt16: u16 [put_u16, try_get_u16],
     |                           ^^^^^^^^^^^ multiple `try_get_u16` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1275:5
     |
1275 |     fn try_get_u16(&mut self) -> Result<u16, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:65:5
     |
65   |     fn try_get_u16(&mut self) -> Result<u16, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_u16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_u16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:88:26
     |
88   |     Int32: i32 [put_i32, try_get_i32],
     |                          ^^^^^^^^^^^ multiple `try_get_i32` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1536:5
     |
1536 |     fn try_get_i32(&mut self) -> Result<i32, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:97:5
     |
97   |     fn try_get_i32(&mut self) -> Result<i32, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:89:26
     |
89   |     Int64: i64 [put_i64, try_get_i64],
     |                          ^^^^^^^^^^^ multiple `try_get_i64` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1710:5
     |
1710 |     fn try_get_i64(&mut self) -> Result<i64, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:105:5
     |
105  |     fn try_get_i64(&mut self) -> Result<i64, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:90:27
     |
90   |     UInt32: u32 [put_u32, try_get_u32],
     |                           ^^^^^^^^^^^ multiple `try_get_u32` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1449:5
     |
1449 |     fn try_get_u32(&mut self) -> Result<u32, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:73:5
     |
73   |     fn try_get_u32(&mut self) -> Result<u32, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_u32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_u32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:91:28
     |
91   |     Float64: f64 [put_f64, try_get_f64],
     |                            ^^^^^^^^^^^ multiple `try_get_f64` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:2274:5
     |
2274 |     fn try_get_f64(&mut self) -> Result<f64, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:113:5
     |
113  |     fn try_get_f64(&mut self) -> Result<f64, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_f64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_f64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:124:25
     |
124  |             let b = buf.try_get_u8()? as u32;
     |                         ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
124  |             let b = Buf::try_get_u8(&mut buf)? as u32;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
124  |             let b = ByteBuf::try_get_u8(&mut buf)? as u32;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:171:25
     |
171  |             let b = buf.try_get_u8()? as u64;
     |                         ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
171  |             let b = Buf::try_get_u8(&mut buf)? as u64;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
171  |             let b = ByteBuf::try_get_u8(&mut buf)? as u64;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:255:13
     |
255  |         buf.try_copy_to_slice(&mut result)?;
     |             ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
255  |         Buf::try_copy_to_slice(&mut buf, &mut result)?;
     |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
255  |         ByteBuf::try_copy_to_slice(&mut buf, &mut result)?;
     |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:363:21
     |
363  |                 buf.try_copy_to_slice(&mut strbuf)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
363  |                 Buf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
363  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:515:21
     |
515  |                 buf.try_copy_to_slice(&mut strbuf)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
515  |                 Buf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
515  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:659:21
     |
659  |                 buf.try_copy_to_slice(&mut data)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
659  |                 Buf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
659  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:808:21
     |
808  |                 buf.try_copy_to_slice(&mut data)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
808  |                 Buf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
808  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

For more information about this error, try `rustc --explain E0034`.
error: could not compile `kafka-protocol` (lib) due to 15 previous errors
➜  proto-tower-kafka git:(main) ✗ cargo test --features=client,server
   Compiling kafka-protocol v0.14.0
error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:48:17
     |
48   |         Ok((buf.try_get_u8()? != 0).into())
     |                 ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
48   |         Ok((Buf::try_get_u8(&mut buf)? != 0).into())
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
48   |         Ok((ByteBuf::try_get_u8(&mut buf)? != 0).into())
     |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:85:23
     |
85   |     Int8: i8 [put_i8, try_get_i8],
     |                       ^^^^^^^^^^ multiple `try_get_i8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1239:5
     |
1239 |     fn try_get_i8(&mut self) -> Result<i8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:81:5
     |
81   |     fn try_get_i8(&mut self) -> Result<i8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i8(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i8(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:86:26
     |
86   |     Int16: i16 [put_i16, try_get_i16],
     |                          ^^^^^^^^^^^ multiple `try_get_i16` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1362:5
     |
1362 |     fn try_get_i16(&mut self) -> Result<i16, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:89:5
     |
89   |     fn try_get_i16(&mut self) -> Result<i16, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:87:27
     |
87   |     UInt16: u16 [put_u16, try_get_u16],
     |                           ^^^^^^^^^^^ multiple `try_get_u16` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1275:5
     |
1275 |     fn try_get_u16(&mut self) -> Result<u16, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:65:5
     |
65   |     fn try_get_u16(&mut self) -> Result<u16, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_u16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_u16(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:88:26
     |
88   |     Int32: i32 [put_i32, try_get_i32],
     |                          ^^^^^^^^^^^ multiple `try_get_i32` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1536:5
     |
1536 |     fn try_get_i32(&mut self) -> Result<i32, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:97:5
     |
97   |     fn try_get_i32(&mut self) -> Result<i32, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:89:26
     |
89   |     Int64: i64 [put_i64, try_get_i64],
     |                          ^^^^^^^^^^^ multiple `try_get_i64` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1710:5
     |
1710 |     fn try_get_i64(&mut self) -> Result<i64, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:105:5
     |
105  |     fn try_get_i64(&mut self) -> Result<i64, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_i64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_i64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:90:27
     |
90   |     UInt32: u32 [put_u32, try_get_u32],
     |                           ^^^^^^^^^^^ multiple `try_get_u32` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1449:5
     |
1449 |     fn try_get_u32(&mut self) -> Result<u32, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:73:5
     |
73   |     fn try_get_u32(&mut self) -> Result<u32, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_u32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_u32(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:91:28
     |
91   |     Float64: f64 [put_f64, try_get_f64],
     |                            ^^^^^^^^^^^ multiple `try_get_f64` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:2274:5
     |
2274 |     fn try_get_f64(&mut self) -> Result<f64, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:113:5
     |
113  |     fn try_get_f64(&mut self) -> Result<f64, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
75   |                     Ok(Buf::try_get_f64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
75   |                     Ok(ByteBuf::try_get_f64(&mut buf)?.into())
     |                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:124:25
     |
124  |             let b = buf.try_get_u8()? as u32;
     |                         ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
124  |             let b = Buf::try_get_u8(&mut buf)? as u32;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
124  |             let b = ByteBuf::try_get_u8(&mut buf)? as u32;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:171:25
     |
171  |             let b = buf.try_get_u8()? as u64;
     |                         ^^^^^^^^^^ multiple `try_get_u8` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1204:5
     |
1204 |     fn try_get_u8(&mut self) -> Result<u8, TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:57:5
     |
57   |     fn try_get_u8(&mut self) -> Result<u8, NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
171  |             let b = Buf::try_get_u8(&mut buf)? as u64;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
171  |             let b = ByteBuf::try_get_u8(&mut buf)? as u64;
     |                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:255:13
     |
255  |         buf.try_copy_to_slice(&mut result)?;
     |             ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
255  |         Buf::try_copy_to_slice(&mut buf, &mut result)?;
     |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
255  |         ByteBuf::try_copy_to_slice(&mut buf, &mut result)?;
     |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:363:21
     |
363  |                 buf.try_copy_to_slice(&mut strbuf)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
363  |                 Buf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
363  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:515:21
     |
515  |                 buf.try_copy_to_slice(&mut strbuf)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
515  |                 Buf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
515  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut strbuf)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:659:21
     |
659  |                 buf.try_copy_to_slice(&mut data)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
659  |                 Buf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
659  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

error[E0034]: multiple applicable items in scope
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/types.rs:808:21
     |
808  |                 buf.try_copy_to_slice(&mut data)?;
     |                     ^^^^^^^^^^^^^^^^^ multiple `try_copy_to_slice` found
     |
note: candidate #1 is defined in the trait `Buf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/bytes-1.10.0/src/buf/buf_impl.rs:1161:5
     |
1161 |     fn try_copy_to_slice(&mut self, mut dst: &mut [u8]) -> Result<(), TryGetError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: candidate #2 is defined in the trait `ByteBuf`
    --> /home/hugh/.cargo/registry/src/index.crates.io-6f17d22bba15001f/kafka-protocol-0.14.0/src/protocol/buf.rs:48:5
     |
48   |     fn try_copy_to_slice(&mut self, dst: &mut [u8]) -> Result<(), NotEnoughBytesError> {
     |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
help: disambiguate the method for candidate #1
     |
808  |                 Buf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
     |
808  |                 ByteBuf::try_copy_to_slice(&mut buf, &mut data)?;
     |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I can't find a specific cause for it, since it is the dependency on kafka-protocol that isn't working. But I imagine it's because I am using a generic as the error type so it "could be anything".
It may be worth explicitly defining these the in code.

@rukai
Copy link
Collaborator

rukai commented Feb 4, 2025

This is affecting me too and is caused by the bytes 1.10.0 release from yesterday.

See: tokio-rs/bytes#767

@phughk
Copy link
Contributor Author

phughk commented Feb 4, 2025

@rukai I nearly have a solution

kafka-protocol = { git = "https://github.com/phughk/kafka-protocol-rs", branch = "107-conflicting-implicit-trait-impl" }

It's not perfect though - here is my project that uses this. Suddenly I have to be explicit about types outside. I can manage that, but I am surprised.

error[E0034]: multiple applicable items in scope                                                                                                               
  --> proto-tower-kafka/src/server/parser.rs:18:41                                                                                                             
   |                                                                                                                                                           
18 |     let api_key = buff.peek_bytes(0..2).try_get_i16().map_err(|_| "API Key")?;                                                                            
   |                                         ^^^^^^^^^^^ multiple `try_get_i16` found                                                                          
   |                                                                                                                                                           
   = note: candidate #1 is defined in an impl of the trait `Buf` for the type `bytes::Bytes`                                                                   
   = note: candidate #2 is defined in an impl of the trait `ByteBuf` for the type `bytes::Bytes`                                                               
help: disambiguate the method for candidate #1                                                                                                                 
   |                                                                                                                                                           
18 |     let api_key = Buf::try_get_i16(&mut buff.peek_bytes(0..2)).map_err(|_| "API Key")?;                                                                   
   |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                            
help: disambiguate the method for candidate #2                                                                                                                 
   |                                                                                                                                                           
18 |     let api_key = ByteBuf::try_get_i16(&mut buff.peek_bytes(0..2)).map_err(|_| "API Key")?;                                                               
   |                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                                                                        
                                                                                                                                                               
error[E0034]: multiple applicable items in scope                                                                                                               
  --> proto-tower-kafka/src/server/parser.rs:19:45                                                                                                             
   |                                                                                                                                                           
19 |     let api_version = buff.peek_bytes(2..4).try_get_i16().map_err(|_| "API Version")?;                                                                    
   |                                             ^^^^^^^^^^^ multiple `try_get_i16` found                                                                      
   |                                                                                                                                                           
   = note: candidate #1 is defined in an impl of the trait `Buf` for the type `bytes::Bytes`                                                                   
   = note: candidate #2 is defined in an impl of the trait `ByteBuf` for the type `bytes::Bytes`                                                               
help: disambiguate the method for candidate #1                                                                                                                 
   |
19 |     let api_version = Buf::try_get_i16(&mut buff.peek_bytes(2..4)).map_err(|_| "API Version")?;
   |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
help: disambiguate the method for candidate #2
   |
19 |     let api_version = ByteBuf::try_get_i16(&mut buff.peek_bytes(2..4)).map_err(|_| "API Version")?;
   |                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

rukai pushed a commit that referenced this issue Feb 4, 2025
@rukai rukai mentioned this issue Feb 4, 2025
@rukai
Copy link
Collaborator

rukai commented Feb 4, 2025

Closed by #110

@rukai rukai closed this as completed Feb 4, 2025
@rukai
Copy link
Collaborator

rukai commented Feb 4, 2025

It's not perfect though - here is my project that uses this. Suddenly I have to be explicit about types outside. I can manage that, but I am surprised.

Thanks, I've raised #111 to address that.

@phughk
Copy link
Contributor Author

phughk commented Feb 4, 2025

On a second look, not surprised - the conflict still exists :)
Thanks for merging and closing so quickly!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants