hotload 0.9.0

Zero cost hot update dynamic library; supporting DLL, SO
# dlopen2

[![crates.io](https://crates.io/crates/hotload)

This is a fork of the original, now unmaintained [`dlopen`](https://github.com/szymonwieloch/rust-dlopen) with updated dependencies, bug fixes and some new features.

## Overview


This library is my effort to make use of dynamic link libraries in Rust simple.
Previously existing solutions were either unsafe, provided huge overhead of required writing too much code to achieve simple things.
I hope that this library will help you to quickly get what you need and avoid errors.

## Quick example


```rust
use dlopen2::wrapper::{Container, WrapperApi};
use hotload::types::Hotload;

#[derive(WrapperApi)]

struct MyApi {
    test_print: fn(msg: String),
    init_data: fn(msg: String),
    stop_runtime: fn(),
}

fn main(){
    let dll: Hotload<MyApi> = Hotload::new("../call_lib/target/release/call_lib.dll");
    dll.init_load().unwrap();

    let mut count = 0;
    loop {
        count += 1;
        dll.test_print(format!("msg{count}"));
    }
}
```

## Features


### Main features


* Zero cost hot update dynamic library; supporting DLL, SO


## Comparison with other libraries


| Feature                            | dlopen2    | [hotload]https://gitee.com/guoyucode/hotload | [hot-lib-reloader]https://crates.io/crates/hot-lib-reloader/0.7.0 |
|------------------------------------|------------|---------------------------------------------------------|-------------------------------------------------|
| Basic functionality                | Yes        | Yes        | Yes       |
| Multiplatform                      | Yes        | Yes        | Yes       |
| Dangling symbol prevention         | Yes        | Yes        | Yes       |
| Thread safety                      | Yes        | Yes | **No support for SetErrorMode (library may block the application on Windows)** |
| Loading of symbols into structures | Yes        | Yes    | **No** |
| Overhead                           | Minimal    | Minimal    | **Some overhead** |
| Low-level, unsafe API              | Yes        | Yes        | Yes       |
| Object-oriented friendly           | Yes        | Yes       | Yes     |
| Load from the program itself       | Yes        | Yes       | **No**  |
| Obtaining address information (dladdr) | Yes    | Yes | **No** |
| Auto reload | **No**    | Yes | Yes |
| Is haved load new dll event | **No**    | Yes | **No** |
| Zero cost, Is not lock | **No**    | Yes | **No** |


## Usage


Cargo.toml:

```toml
[dependencies]
dlopen2 = "0.6"
hotload = "0.9"
```

## Documentation


[Cargo documentation](https://docs.rs/hotload)

## License


This code is licensed under the [MIT](./LICENSE) license.

## Changelog


[GitHub](https://gitee.com/guoyucode/hotload)

## Acknowledgement


Special thanks to [dlopen2](https://github.com/nagisa) and [hot-lib-reloader](https://crates.io/crates/hot-lib-reloader)