I recommend adding this repository as a submodule and building from source. You'll need the `cdylib` build of the native library at runtime for the relevant platform. On Linux/macOS/BSD, this should be `servicepoint2/target/release/libservicepoint2.so`.
Building the `ServicePoint2` class library automatically regenerates the BindGen folder, which means the language binding will always match your library.
Uses C bindings internally to provide a similar API to rust. Things to keep in mind:
- You will get a `NullPointerException` when trying to call a method where the native instance has been consumed already (e.g. when `Send`ing a command instance twice). Send a clone instead of the original if you want to keep using it.
- Some lower-level APIs _will_ panic in native code when used improperly.
Example: manipulating the `Span<byte>` of an object after freeing the instance.
- C# specifics are documented in the library. Use the rust documentation for everything else. Naming and semantics are the same apart from CamelCase instead of kebap_case.
- You will only get rust backtraces in debug builds of the native code.
- F# is not explicitly tested. If there are usability or functionality problems, please open an issue.
```csharp
using ServicePoint2;
// using statement calls Dispose() on scope exit, which frees unmanaged instances
using var connection = Connection.Open("127.0.0.1:2342");
using var pixels = PixelGrid.New(Constants.PixelWidth, Constants.PixelHeight);
- tanks game (C#): https://github.com/kaesaecracker/cccb-tanks-cs
To add yourself to the list, open a pull request.
## Where is servicepoint1?
This library is a spiritual mix of a not-yet-working rust library called `servicepoint` and a bunch of working but also unfinished C# code. Because most of the API concept and a bunch of code is taken from the rust library, the result is called `servicepoint2`.
## Contributing
Contributions are accepted in any form (issues, documentation, feature requests, code, review, ...).