GithubHelp home page GithubHelp logo

rnet's Introduction

rnet

Easily call into Rust from C# or other .net langauges.

Usage

  1. Add rnet::root!(); to your crate.
  2. Use #[derive(Net)] on any structs to be shared with .net.
  3. Apply the #[net] attribute to any standalone functions which should be callable from .net.
  4. Build your rust project as a cdylib.
  5. Generate C# bindings for your project:
    cargo install rnet-gen
    rnet-gen "<path to .dll/.so/.dylib>" > "<path to generated file.cs>"
    
  6. Include the C# file in your .net project.
  7. Add a link to the compiled rust library to your .net project, and set it to "Copy if newer".
  8. Optional: Configure the above steps to run automatically as pre-build steps.

For languages other than C#, you'll need to build the exported C# file into its own class library, and then add a reference to that from a project of any .net language.

rnet's People

Contributors

diggsey avatar

Watchers

 avatar  avatar

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.