MCPcopy Index your code
hub / github.com/Diggsey/rnet

github.com/Diggsey/rnet @0.3.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.3.1 ↗ · + Follow
394 symbols 569 edges 26 files 10 documented · 3% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

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.

Extension points exported contracts — how you extend this code

Net (Interface)
# Safety This trait is implemented for Rust types which have an equivalent type within .net. [13 implementers]
rnet/src/lib.rs
IOpaqueHandle (Interface)
(no doc)
rnet-gen/src/common.cs
FromNet (Interface)
# Safety This trait is implemented for Rust types which can be received from .net code. [13 implementers]
rnet/src/from_net.rs
ToNet (Interface)
# Safety This trait is implemented for Rust types which can be sent to .net code. [13 implementers]
rnet/src/to_net.rs
FromNetReturn (Interface)
# Safety This trait is implemented for Rust types which can be returned from .net delegates. This is a superset of types [4 …
rnet/src/from_net.rs
ToNetReturn (Interface)
# Safety This trait is implemented for Rust types which can be returned from exported functions. This is a superset of t [4 …
rnet/src/to_net.rs

Core symbols most depended-on inside this repo

check_passed
called by 14
rnet-tests/src/lib.rs
get_unique_identifier
called by 13
rnet/src/types.rs
clone
called by 8
rnet/src/delegates.rs
parse
called by 4
rnet-macros/src/lib.rs
into_raw
called by 3
rnet/src/std_impls.rs
Alloc
called by 3
rnet-gen/src/common.cs
Free
called by 3
rnet-gen/src/common.cs
into_raw
called by 2
rnet/src/delegates.rs

Shape

Method 264
Class 60
Function 59
Interface 11

Languages

C#65%
Rust35%

Modules by API surface

rnet-tests-cs/Generated.cs108 symbols
rnet-example-cs2/Generated.cs51 symbols
rnet-example-cs/Generated.cs51 symbols
rnet-tests/src/lib.rs36 symbols
rnet-gen/src/common.cs29 symbols
rnet/src/types.rs18 symbols
rnet/src/std_impls.rs15 symbols
rnet-macros/src/lib.rs12 symbols
rnet-tests-cs/SmokeTests.cs9 symbols
rnet/src/lib.rs8 symbols
rnet/src/uuid_impls.rs7 symbols
rnet-example/src/lib.rs7 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add rnet \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact