Coder Social home page Coder Social logo

rust-libnice's Introduction

libnice

Safe, high- and low-level Rust bindings to libnice.

Usage

See the connects_and_transmits_data test in the file src/ice.rs for a full example of the high-level bindings.

License

libnice is licensed under both the Mozilla Public License version 1.1 and the GNU Lesser General Public License version 2.1 (just like libnice itself). For the full text of these licenses, see the files LICENSE.MPL and LICENSE.LGPL respectively.

rust-libnice's People

Contributors

johni0702 avatar mathieuduponchelle avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

rust-libnice's Issues

Error E0308 on compilation

   Compiling libnice v0.2.0
error[E0308]: mismatched types
   --> /home/freeman/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.2.0/src/ffi.rs:258:17
    |
258 |                 buf.as_ptr() as *const i8,
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
    = note: expected raw pointer `*const u8`
               found raw pointer `*const i8`

error[E0308]: mismatched types
   --> /home/freeman/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.2.0/src/ffi.rs:515:34
    |
515 |             self_foundation[i] = foundation[i] as i8;
    |                                  ^^^^^^^^^^^^^^^^^^^ expected `u8`, found `i8`
    |
help: you can convert an `i8` to `u8` and panic if the converted value wouldn't fit
    |
515 |             self_foundation[i] = (foundation[i] as i8).try_into().unwrap();
    |                                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0308`.
error: could not compile `libnice`.

To learn more, run the command again with --verbose.

Compilation fails on FreeBSD 12

FreeBSD 12.1-RELEASE-p7 FreeBSD 12.1-RELEASE-p7 GENERIC  amd64

error[E0308]: mismatched types
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.2.1/src/ffi.rs:708:35
    |
708 |             raw_addr.sin_family = libc::AF_INET as u16;
    |                                   ^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
    |
help: you can convert `raw_addr.sin_family` from `u8` to `u16`, matching the type of `libc::AF_INET as u16`
    |
708 |             u16::from(raw_addr.sin_family) = libc::AF_INET as u16;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0308]: mismatched types
   --> /home/user/.cargo/registry/src/github.com-1ecc6299db9ec823/libnice-0.2.1/src/ffi.rs:714:36
    |
714 |             raw_addr.sin6_family = libc::AF_INET6 as u16;
    |                                    ^^^^^^^^^^^^^^^^^^^^^ expected `u8`, found `u16`
    |
help: you can convert `raw_addr.sin6_family` from `u8` to `u16`, matching the type of `libc::AF_INET6 as u16`
    |
714 |             u16::from(raw_addr.sin6_family) = libc::AF_INET6 as u16;
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 2 previous errors

Replacing u16 with u8 seems to work.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.