#bindings #sciter #u64 #ui #window #api #string

rsciter

Unofficial Rust bindings for Sciter

5 releases

0.0.6 Apr 8, 2024
0.0.5 Aug 6, 2023
0.0.4 Jul 30, 2023

#7 in #u64

Download history 4/week @ 2024-02-25 34/week @ 2024-03-03 12/week @ 2024-03-10 4/week @ 2024-03-31 128/week @ 2024-04-07 4/week @ 2024-04-14

136 downloads per month

Apache-2.0

240KB
6.5K SLoC

Description

Work in Progress License

This is unofficial Rust bindings for Sciter

Disclaimer

This is a work in progress library and is not yet ready for production use.

Differencies from rust-sciter

  • Never panics

  • Uses bindgen instead of hand-written code.

  • Utilizes Sciter's own functions for windows/application management.

  • The primary goal is not to provide a complete Sciter API, but to simplify the interaction between the backend (in Rust) and the frontend (Sciter.JS UI). For example, exporting functions is as easy as:

    #[rsciter::xmod] // mark the module, that's it!
    mod NativeModule {
        pub fn append_log(id: u64, message: &str) { ... }
        pub fn user_name() -> String { ... }
    }
    
    struct StatefullApi {
        state: u64,
    }
    
    #[rsciter::xmod] // or struct impl block
    impl StatefullApi {
        pub fn sum(&self, a: u64, b: u64) -> u64 {
            a + b + self.state
        }
    
        pub fn update(&mut self, a: u64) {
            self.state = a;
        }
    
        pub fn state(&self) -> u64 {
            self.state
        }
    }
    

    For details, see this samples:

Dependencies

~0.5–40MB
~581K SLoC