Skip to main content

Crate inline_csharp_core

Crate inline_csharp_core 

Source
Expand description

Core runtime support for inline_csharp.

This crate is an implementation detail of inline_csharp_macros. End users should depend on inline_csharp instead of this crate directly.

Public items:

  • CsharpError — error type returned by run_csharp and by the csharp! / csharp_fn! macros at program runtime.
  • run_csharp — compile (if needed) and run a generated C# class.
  • expand_dotnet_args — shell-expand an option string into individual args.
  • cache_dir — compute the deterministic temp-dir path for a C# class.

Enums§

CsharpError
All errors that csharp! and csharp_fn! can return at runtime (and that ct_csharp! maps to compile_error! diagnostics at build time).

Functions§

base_cache_dir
Resolve the root directory used to cache compiled C# assemblies.
cache_dir
Compute the deterministic cache-dir path used to store compiled C# assemblies.
detect_target_framework
Detect the installed .NET target framework moniker (e.g. "net8.0") by running dotnet --version and extracting the major version number.
expand_dotnet_args
Shell-expand raw (expanding env vars and ~), then split into individual arguments (respecting quotes). Returns an empty vec if raw is empty.
generate_csproj
Generate the XML content for a .csproj file.
run_csharp
Compile (if needed) and run a generated C# class, returning raw stdout bytes.