scottlamb / retina

High-level RTSP multimedia streaming library, in Rust
https://crates.io/crates/retina
Apache License 2.0
244 stars 48 forks source link

no function or associated item named `unmarshal` found for struct #8

Closed lattice0 closed 3 years ago

lattice0 commented 3 years ago

I'm trying to figure out what is happening here. Compiling the project on its folder has no errors, but compiling my project when it depends on retina, gives this:

error[E0599]: no function or associated item named `unmarshal` found for struct `Header` in the current scope
   --> src/external/retina/src/client/rtp.rs:193:49
    |
193 |             let h = match rtcp::header::Header::unmarshal(&data) {
    |                                                 ^^^^^^^^^ function or associated item not found in `Header`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use webrtc_util::marshal::Unmarshal;`

error[E0599]: no function or associated item named `unmarshal` found for struct `rtcp::sender_report::SenderReport` in the current scope
   --> src/external/retina/src/client/rtp.rs:211:66
    |
211 |                     let pkt = rtcp::sender_report::SenderReport::unmarshal(&pkt)
    |                                                                  ^^^^^^^^^ function or associated item not found in `rtcp::sender_report::SenderReport`
    |
    = help: items from traits can only be used if the trait is in scope
    = note: the following trait is implemented but not in scope; perhaps add a `use` for it:
            `use webrtc_util::marshal::Unmarshal;`

error: aborting due to 2 previous errors; 1 warning emitted

have you had something like this? I have no idea about what is happening

scottlamb commented 3 years ago

The rtcp crate had an accidental semvar breakage between version 0.2.2 and 0.2.3. The current version of retina only works with the former. So the workaround is to specify rtcp 0.2.2 in your lockfile via something like cargo update --package rtcp --precise 0.2.2.

I'll make sure the next retina release I prepare works without any lockfile manipulation.