Project

General

Profile

JBMirust: A Safe and Seamless Rust-to-AdiIRC SDK

Added by JD Byrnes 11 days ago

Mirust is a lightweight SDK designed to simplify the process of exporting Rust functions to AdiIRC via DLLs. It provides a safe, idiomatic interface for Rust developers while ensuring full compatibility with AdiIRC's environment.

Key features:
  • Automatic DLL Lifecycle Management
    Handles LoadDll and UnloadDll automatically, eliminating boilerplate and setup hassle.
  • Robust String Encoding
    Transparently encodes and decodes both ANSI and Unicode strings into UTF-8 Rust strings, ensuring smooth interoperability.
  • Selective Function Exposure
    Functions can be annotated with (dllcall = false) to restrict access exclusively to $dllcall, preventing accidental use via $dll which could lock up AdiIRC.
  • Memory Safety by Design
    Mirust enforces safe Rust practices, preventing out-of-bounds memory access and avoiding unsafe pointer manipulation.

https://crates.io/crates/mirust/

Example function

#[mirust_fn]
fn my_command(
    m_wnd: HWND,
    a_wnd: HWND,
    data: String,
    parms: String,
    show: BOOL,
    nopause: BOOL,
) -> mirust::MircResult {

    let command = "echo -st * Message from Rust: $1-".to_string();
    let my_string = format!("You sent me: {}", data);

    mirust::MircResult {
        code: 2, // Command
        data: Some(command),
        parms: Some(my_string),
    }
}

Mirust works with AdiIRC on x86 (32 bit), x86_64 (64 bit) and ARM64.


Replies (1)

    (1-1/1)