diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml
index fbf93a9..884a165 100644
--- a/.github/workflows/rust.yml
+++ b/.github/workflows/rust.yml
@@ -29,17 +29,7 @@ jobs:
- name: Run Clippy
run: cargo clippy --all-targets --all-features
-
- name: build default features
run: cargo build --all --verbose
- - name: build default features -- examples
- run: cargo build --examples --verbose
- name: test default features
run: cargo test --all --verbose
-
- - name: build all features
- run: cargo build --all-features --verbose
- - name: build all features -- examples
- run: cargo build --all-features --examples --verbose
- - name: test all features
- run: cargo test --all --all-features --verbose
diff --git a/about_display.md b/about_display.md
deleted file mode 100644
index 4fe7911..0000000
--- a/about_display.md
+++ /dev/null
@@ -1,41 +0,0 @@
-# About the display
-
-- Resolution: 352x160=56,320 pixels
-- Pixels are grouped into 44x20=880 tiles (8x8=64 pixels each)
-- Smallest addressable unit: row of pixels inside of a tile (8 pixels = 1 byte)
-- The brightness can only be set per tile
-- Screen content can be changed using a simple UDP protocol
-- Between each row of tiles, there is a gap of around 4 pixels size. This gap changes the aspect ratio of the display.
-
-### Binary format
-
-A UDP package sent to the display has a header size of 10 bytes.
-Each header value has a size of two bytes (unsigned 16 bit integer).
-Depending on the command, there can be a payload following the header.
-
-To change screen contents, these commands are the most relevant:
-
-1. Clear screen
- - command: `0x0002`
- - (rest does not matter)
-2. Send CP437 data: render specified text into rectangular region
- - command: `0x0003`
- - top left tile x
- - top left tile y
- - width in tiles
- - height in tiles
- - payload: (width in tiles * height in tiles) bytes
- - 1 byte = 1 character
- - each character is rendered into one tile (mono-spaced)
- - characters are encoded using code page 437
-3. Send bitmap window: set pixel states for a rectangular region
- - command: `0x0013`
- - top left tile x
- - top left _pixel_ y
- - width in tiles
- - height in _pixels_
- - payload: (width in tiles * height in pixels) bytes
- - network byte order
- - 1 bit = 1 pixel
-
-There are other commands implemented as well, e.g. for changing the brightness.
diff --git a/flake.lock b/flake.lock
index b07ad46..9e70e85 100644
--- a/flake.lock
+++ b/flake.lock
@@ -1,25 +1,5 @@
{
"nodes": {
- "naersk": {
- "inputs": {
- "nixpkgs": [
- "nixpkgs"
- ]
- },
- "locked": {
- "lastModified": 1736429655,
- "narHash": "sha256-BwMekRuVlSB9C0QgwKMICiJ5EVbLGjfe4qyueyNQyGI=",
- "owner": "nix-community",
- "repo": "naersk",
- "rev": "0621e47bd95542b8e1ce2ee2d65d6a1f887a13ce",
- "type": "github"
- },
- "original": {
- "owner": "nix-community",
- "repo": "naersk",
- "type": "github"
- }
- },
"nixpkgs": {
"locked": {
"lastModified": 1739357830,
@@ -38,7 +18,6 @@
},
"root": {
"inputs": {
- "naersk": "naersk",
"nixpkgs": "nixpkgs"
}
}
diff --git a/flake.nix b/flake.nix
index 5875a5e..f619fe0 100644
--- a/flake.nix
+++ b/flake.nix
@@ -3,17 +3,12 @@
inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-24.11";
- naersk = {
- url = "github:nix-community/naersk";
- inputs.nixpkgs.follows = "nixpkgs";
- };
};
outputs =
inputs@{
self,
nixpkgs,
- naersk,
}:
let
lib = nixpkgs.lib;
@@ -51,10 +46,6 @@
cargo-tarpaulin
];
})
- ruby
- dotnet-sdk_8
- gcc
- gnumake
xe
xz
pkg-config
diff --git a/generate-bindings.sh b/generate-bindings.sh
deleted file mode 100755
index bfb571c..0000000
--- a/generate-bindings.sh
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env bash
-set -e
-
-cargo build --release
-
-SCRIPT_PATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
-TARGET_PATH="$(realpath "$SCRIPT_PATH"/../../target/release)"
-SERVICEPOINT_SO="$TARGET_PATH/libservicepoint_binding_uniffi.so"
-LIBRARIES_PATH="$SCRIPT_PATH/libraries"
-
-echo "Source: $SERVICEPOINT_SO"
-echo "Output: $LIBRARIES_PATH"
-
-BINDGEN="cargo run --features=uniffi/cli --bin uniffi-bindgen -- "
-BINDGEN_CS="cargo run --features=cs --bin uniffi-bindgen-cs -- "
-BINDGEN_GO="cargo run --features=go --bin uniffi-bindgen-go -- "
-COMMON_ARGS="--library $SERVICEPOINT_SO"
-
-${BINDGEN} generate $COMMON_ARGS --language python --out-dir "$LIBRARIES_PATH/python"
-${BINDGEN} generate $COMMON_ARGS --language kotlin --out-dir "$LIBRARIES_PATH/kotlin"
-${BINDGEN} generate $COMMON_ARGS --language swift --out-dir "$LIBRARIES_PATH/swift"
-${BINDGEN} generate $COMMON_ARGS --language ruby --out-dir "$LIBRARIES_PATH/ruby/lib"
-${BINDGEN_CS} $COMMON_ARGS --out-dir "$LIBRARIES_PATH/csharp/ServicePoint"
-${BINDGEN_GO} $COMMON_ARGS --out-dir "$LIBRARIES_PATH/go/"
diff --git a/libraries/.gitignore b/libraries/.gitignore
deleted file mode 100644
index a875c72..0000000
--- a/libraries/.gitignore
+++ /dev/null
@@ -1,4 +0,0 @@
-go
-kotlin
-python
-swift
\ No newline at end of file
diff --git a/libraries/csharp/.gitignore b/libraries/csharp/.gitignore
deleted file mode 100644
index 1746e32..0000000
--- a/libraries/csharp/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-obj
diff --git a/libraries/csharp/ServicePoint.Example/.gitignore b/libraries/csharp/ServicePoint.Example/.gitignore
deleted file mode 100644
index 1746e32..0000000
--- a/libraries/csharp/ServicePoint.Example/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-bin
-obj
diff --git a/libraries/csharp/ServicePoint.Example/Program.cs b/libraries/csharp/ServicePoint.Example/Program.cs
deleted file mode 100644
index 48462a5..0000000
--- a/libraries/csharp/ServicePoint.Example/Program.cs
+++ /dev/null
@@ -1,19 +0,0 @@
-using System.Threading;
-using ServicePoint;
-
-var connection = new Connection("127.0.0.1:2342");
-connection.Send(Command.Clear());
-
-connection.Send(Command.Brightness(5));
-
-var pixels = Bitmap.NewMaxSized();
-for (ulong offset = 0; offset < ulong.MaxValue; offset++)
-{
- pixels.Fill(false);
-
- for (ulong y = 0; y < pixels.Height(); y++)
- pixels.Set((y + offset) % pixels.Width(), y, true);
-
- connection.Send(Command.BitmapLinearWin(0, 0, pixels));
- Thread.Sleep(14);
-}
diff --git a/libraries/csharp/ServicePoint.Example/ServicePoint.Example.csproj b/libraries/csharp/ServicePoint.Example/ServicePoint.Example.csproj
deleted file mode 100644
index 3e99664..0000000
--- a/libraries/csharp/ServicePoint.Example/ServicePoint.Example.csproj
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
- Exe
- net8.0
- ServicePoint.Example
- disable
- enable
-
-
-
-
-
-
-
diff --git a/libraries/csharp/ServicePoint.Tests/BitmapTests.cs b/libraries/csharp/ServicePoint.Tests/BitmapTests.cs
deleted file mode 100644
index 9e55a80..0000000
--- a/libraries/csharp/ServicePoint.Tests/BitmapTests.cs
+++ /dev/null
@@ -1,16 +0,0 @@
-namespace ServicePoint.Tests;
-
-public class BitmapTests
-{
- [Fact]
- public void BasicFunctions()
- {
- var bitmap = new Bitmap(8, 2);
- Assert.False(bitmap.Get(0, 0));
- Assert.False(bitmap.Get(bitmap.Width() - 1, bitmap.Height() - 1));
- bitmap.Fill(true);
- Assert.True(bitmap.Get(1, 1));
- bitmap.Set(1, 1, false);
- Assert.False(bitmap.Get(1, 1));
- }
-}
diff --git a/libraries/csharp/ServicePoint.Tests/CharGridTests.cs b/libraries/csharp/ServicePoint.Tests/CharGridTests.cs
deleted file mode 100644
index de849c6..0000000
--- a/libraries/csharp/ServicePoint.Tests/CharGridTests.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-namespace ServicePoint.Tests;
-
-public class CharGridTests
-{
- [Fact]
- public void BasicFunctions()
- {
- var grid = new CharGrid(8, 2);
- Assert.Equal("\0", grid.Get(0, 0));
- Assert.Equal("\0", grid.Get(grid.Width() - 1, grid.Height() - 1));
- grid.Fill(" ");
- Assert.Equal(" ", grid.Get(1, 1));
- grid.Set(1, 1, "-");
- Assert.Equal("-", grid.Get(1, 1));
- Assert.Throws(() => grid.Get(8, 2));
- }
-
- [Fact]
- public void RowAndCol()
- {
- var grid = new CharGrid(3, 2);
- Assert.Equal("\0\0\0", grid.GetRow(0));
- grid.Fill(" ");
- Assert.Equal(" ", grid.GetCol(1));
- Assert.Throws(() => grid.GetCol(3));
- Assert.Throws(() => grid.SetRow(1, "Text"));
- grid.SetRow(1, "Foo");
- Assert.Equal("Foo", grid.GetRow(1));
- Assert.Equal(" o", grid.GetCol(2));
- }
-}
diff --git a/libraries/csharp/ServicePoint.Tests/CommandTests.cs b/libraries/csharp/ServicePoint.Tests/CommandTests.cs
deleted file mode 100644
index 4687162..0000000
--- a/libraries/csharp/ServicePoint.Tests/CommandTests.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-namespace ServicePoint.Tests;
-
-public class CommandTests
-{
- private Connection _connection = Connection.NewFake();
-
- [Fact]
- public void ClearSendable()
- {
- _connection.Send(Command.Clear());
- }
-
- [Fact]
- public void BrightnessSendable()
- {
- _connection.Send(Command.Brightness(5));
- }
-
- [Fact]
- public void InvalidBrightnessThrows()
- {
- Assert.Throws(() => Command.Brightness(42));
- }
-
- [Fact]
- public void FadeOutSendable()
- {
- _connection.Send(Command.FadeOut());
- }
-
- [Fact]
- public void HardResetSendable()
- {
- _connection.Send(Command.HardReset());
- }
-
- [Fact]
- public void BitmapLinearWinSendable()
- {
- _connection.Send(Command.BitmapLinearWin(0, 0, Bitmap.NewMaxSized(), CompressionCode.Uncompressed));
- }
-}
diff --git a/libraries/csharp/ServicePoint.Tests/ConnectionTests.cs b/libraries/csharp/ServicePoint.Tests/ConnectionTests.cs
deleted file mode 100644
index be0000f..0000000
--- a/libraries/csharp/ServicePoint.Tests/ConnectionTests.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-namespace ServicePoint.Tests;
-
-public class ConnectionTests
-{
- [Fact]
- public void InvalidHostnameThrows()
- {
- Assert.Throws(() => new Connection(""));
- Assert.Throws(() => new Connection("-%6$§"));
- }
-}
diff --git a/libraries/csharp/ServicePoint.Tests/GlobalUsings.cs b/libraries/csharp/ServicePoint.Tests/GlobalUsings.cs
deleted file mode 100644
index a09810b..0000000
--- a/libraries/csharp/ServicePoint.Tests/GlobalUsings.cs
+++ /dev/null
@@ -1,2 +0,0 @@
-global using Xunit;
-global using ServicePoint;
diff --git a/libraries/csharp/ServicePoint.Tests/ServicePoint.Tests.csproj b/libraries/csharp/ServicePoint.Tests/ServicePoint.Tests.csproj
deleted file mode 100644
index 50500b6..0000000
--- a/libraries/csharp/ServicePoint.Tests/ServicePoint.Tests.csproj
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- net8.0
- disable
- enable
-
- false
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libraries/csharp/ServicePoint/Constants.cs b/libraries/csharp/ServicePoint/Constants.cs
deleted file mode 100644
index 58cf560..0000000
--- a/libraries/csharp/ServicePoint/Constants.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-
-using ServicePoint;
-
-public static class ServicePointConstants
-{
- private static readonly Constants _instance = ServicepointBindingUniffiMethods.GetConstants();
-
- public static readonly ulong PixelWidth = _instance.pixelWidth;
- public static readonly ulong PixelHeight = _instance.pixelHeight;
- public static readonly ulong PixelCount = _instance.pixelCount;
- public static readonly ulong TileWidth = _instance.tileWidth;
- public static readonly ulong TileHeight = _instance.tileHeight;
- public static readonly ulong TileSize = _instance.tileSize;
-}
diff --git a/libraries/csharp/ServicePoint/ServicePoint.csproj b/libraries/csharp/ServicePoint/ServicePoint.csproj
deleted file mode 100644
index 70d12b3..0000000
--- a/libraries/csharp/ServicePoint/ServicePoint.csproj
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
-
- net8.0
- disable
- enable
- true
-
-
-
- ServicePoint
- 0.13.1
- Repository Authors
- None
- ServicePoint
- CCCB
-
- C# bindings for the rust crate servicepoint. You will need a suitable native shared library to use this.
- For documentation, see the rust documentation: https://docs.rs/servicepoint/latest/servicepoint/.
- Note that this library is still in early development. Breaking changes are expected before 1.0 is released.
-
- README.md
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- libservicepoint_binding_uniffi.so
-
-
-
-
- libservicepoint_binding_uniffi.so
-
-
-
-
-
-
-
-
-
-
-
diff --git a/libraries/csharp/ServicePoint/servicepoint_binding_uniffi.cs b/libraries/csharp/ServicePoint/servicepoint_binding_uniffi.cs
deleted file mode 100644
index 2039307..0000000
--- a/libraries/csharp/ServicePoint/servicepoint_binding_uniffi.cs
+++ /dev/null
@@ -1,3225 +0,0 @@
-//
-// This file was generated by uniffi-bindgen-cs v0.8.3+v0.25.0
-// See https://github.com/NordSecurity/uniffi-bindgen-cs for more information.
-//
-
-#nullable enable
-
-
-
-
-using System;
-using System.Collections.Generic;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-namespace ServicePoint;
-
-
-
-// This is a helper for safely working with byte buffers returned from the Rust code.
-// A rust-owned buffer is represented by its capacity, its current length, and a
-// pointer to the underlying data.
-
-[StructLayout(LayoutKind.Sequential)]
-internal struct RustBuffer {
- public int capacity;
- public int len;
- public IntPtr data;
-
- public static RustBuffer Alloc(int size) {
- return _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- var buffer = _UniFFILib.ffi_servicepoint_binding_uniffi_rustbuffer_alloc(size, ref status);
- if (buffer.data == IntPtr.Zero) {
- throw new AllocationException($"RustBuffer.Alloc() returned null data pointer (size={size})");
- }
- return buffer;
- });
- }
-
- public static void Free(RustBuffer buffer) {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.ffi_servicepoint_binding_uniffi_rustbuffer_free(buffer, ref status);
- });
- }
-
- public static BigEndianStream MemoryStream(IntPtr data, int length) {
- unsafe {
- return new BigEndianStream(new UnmanagedMemoryStream((byte*)data.ToPointer(), length));
- }
- }
-
- public BigEndianStream AsStream() {
- unsafe {
- return new BigEndianStream(new UnmanagedMemoryStream((byte*)data.ToPointer(), len));
- }
- }
-
- public BigEndianStream AsWriteableStream() {
- unsafe {
- return new BigEndianStream(new UnmanagedMemoryStream((byte*)data.ToPointer(), capacity, capacity, FileAccess.Write));
- }
- }
-}
-
-// This is a helper for safely passing byte references into the rust code.
-// It's not actually used at the moment, because there aren't many things that you
-// can take a direct pointer to managed memory, and if we're going to copy something
-// then we might as well copy it into a `RustBuffer`. But it's here for API
-// completeness.
-
-[StructLayout(LayoutKind.Sequential)]
-internal struct ForeignBytes {
- public int length;
- public IntPtr data;
-}
-
-
-// The FfiConverter interface handles converter types to and from the FFI
-//
-// All implementing objects should be public to support external types. When a
-// type is external we need to import it's FfiConverter.
-internal abstract class FfiConverter {
- // Convert an FFI type to a C# type
- public abstract CsType Lift(FfiType value);
-
- // Convert C# type to an FFI type
- public abstract FfiType Lower(CsType value);
-
- // Read a C# type from a `ByteBuffer`
- public abstract CsType Read(BigEndianStream stream);
-
- // Calculate bytes to allocate when creating a `RustBuffer`
- //
- // This must return at least as many bytes as the write() function will
- // write. It can return more bytes than needed, for example when writing
- // Strings we can't know the exact bytes needed until we the UTF-8
- // encoding, so we pessimistically allocate the largest size possible (3
- // bytes per codepoint). Allocating extra bytes is not really a big deal
- // because the `RustBuffer` is short-lived.
- public abstract int AllocationSize(CsType value);
-
- // Write a C# type to a `ByteBuffer`
- public abstract void Write(CsType value, BigEndianStream stream);
-
- // Lower a value into a `RustBuffer`
- //
- // This method lowers a value into a `RustBuffer` rather than the normal
- // FfiType. It's used by the callback interface code. Callback interface
- // returns are always serialized into a `RustBuffer` regardless of their
- // normal FFI type.
- public RustBuffer LowerIntoRustBuffer(CsType value) {
- var rbuf = RustBuffer.Alloc(AllocationSize(value));
- try {
- var stream = rbuf.AsWriteableStream();
- Write(value, stream);
- rbuf.len = Convert.ToInt32(stream.Position);
- return rbuf;
- } catch {
- RustBuffer.Free(rbuf);
- throw;
- }
- }
-
- // Lift a value from a `RustBuffer`.
- //
- // This here mostly because of the symmetry with `lowerIntoRustBuffer()`.
- // It's currently only used by the `FfiConverterRustBuffer` class below.
- protected CsType LiftFromRustBuffer(RustBuffer rbuf) {
- var stream = rbuf.AsStream();
- try {
- var item = Read(stream);
- if (stream.HasRemaining()) {
- throw new InternalException("junk remaining in buffer after lifting, something is very wrong!!");
- }
- return item;
- } finally {
- RustBuffer.Free(rbuf);
- }
- }
-}
-
-// FfiConverter that uses `RustBuffer` as the FfiType
-internal abstract class FfiConverterRustBuffer: FfiConverter {
- public override CsType Lift(RustBuffer value) {
- return LiftFromRustBuffer(value);
- }
- public override RustBuffer Lower(CsType value) {
- return LowerIntoRustBuffer(value);
- }
-}
-
-
-// A handful of classes and functions to support the generated data structures.
-// This would be a good candidate for isolating in its own ffi-support lib.
-// Error runtime.
-[StructLayout(LayoutKind.Sequential)]
-struct RustCallStatus {
- public sbyte code;
- public RustBuffer error_buf;
-
- public bool IsSuccess() {
- return code == 0;
- }
-
- public bool IsError() {
- return code == 1;
- }
-
- public bool IsPanic() {
- return code == 2;
- }
-}
-
-// Base class for all uniffi exceptions
-public class UniffiException: Exception {
- public UniffiException(): base() {}
- public UniffiException(string message): base(message) {}
-}
-
-public class UndeclaredErrorException: UniffiException {
- public UndeclaredErrorException(string message): base(message) {}
-}
-
-public class PanicException: UniffiException {
- public PanicException(string message): base(message) {}
-}
-
-public class AllocationException: UniffiException {
- public AllocationException(string message): base(message) {}
-}
-
-public class InternalException: UniffiException {
- public InternalException(string message): base(message) {}
-}
-
-public class InvalidEnumException: InternalException {
- public InvalidEnumException(string message): base(message) {
- }
-}
-
-public class UniffiContractVersionException: UniffiException {
- public UniffiContractVersionException(string message): base(message) {
- }
-}
-
-public class UniffiContractChecksumException: UniffiException {
- public UniffiContractChecksumException(string message): base(message) {
- }
-}
-
-// Each top-level error class has a companion object that can lift the error from the call status's rust buffer
-interface CallStatusErrorHandler where E: Exception {
- E Lift(RustBuffer error_buf);
-}
-
-// CallStatusErrorHandler implementation for times when we don't expect a CALL_ERROR
-class NullCallStatusErrorHandler: CallStatusErrorHandler {
- public static NullCallStatusErrorHandler INSTANCE = new NullCallStatusErrorHandler();
-
- public UniffiException Lift(RustBuffer error_buf) {
- RustBuffer.Free(error_buf);
- return new UndeclaredErrorException("library has returned an error not declared in UNIFFI interface file");
- }
-}
-
-// Helpers for calling Rust
-// In practice we usually need to be synchronized to call this safely, so it doesn't
-// synchronize itself
-class _UniffiHelpers {
- public delegate void RustCallAction(ref RustCallStatus status);
- public delegate U RustCallFunc(ref RustCallStatus status);
-
- // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err
- public static U RustCallWithError(CallStatusErrorHandler errorHandler, RustCallFunc callback)
- where E: UniffiException
- {
- var status = new RustCallStatus();
- var return_value = callback(ref status);
- if (status.IsSuccess()) {
- return return_value;
- } else if (status.IsError()) {
- throw errorHandler.Lift(status.error_buf);
- } else if (status.IsPanic()) {
- // when the rust code sees a panic, it tries to construct a rustbuffer
- // with the message. but if that code panics, then it just sends back
- // an empty buffer.
- if (status.error_buf.len > 0) {
- throw new PanicException(FfiConverterString.INSTANCE.Lift(status.error_buf));
- } else {
- throw new PanicException("Rust panic");
- }
- } else {
- throw new InternalException($"Unknown rust call status: {status.code}");
- }
- }
-
- // Call a rust function that returns a Result<>. Pass in the Error class companion that corresponds to the Err
- public static void RustCallWithError(CallStatusErrorHandler errorHandler, RustCallAction callback)
- where E: UniffiException
- {
- _UniffiHelpers.RustCallWithError(errorHandler, (ref RustCallStatus status) => {
- callback(ref status);
- return 0;
- });
- }
-
- // Call a rust function that returns a plain value
- public static U RustCall(RustCallFunc callback) {
- return _UniffiHelpers.RustCallWithError(NullCallStatusErrorHandler.INSTANCE, callback);
- }
-
- // Call a rust function that returns a plain value
- public static void RustCall(RustCallAction callback) {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- callback(ref status);
- return 0;
- });
- }
-}
-
-
-// Big endian streams are not yet available in dotnet :'(
-// https://github.com/dotnet/runtime/issues/26904
-
-class StreamUnderflowException: Exception {
- public StreamUnderflowException() {
- }
-}
-
-class BigEndianStream {
- Stream stream;
- public BigEndianStream(Stream stream) {
- this.stream = stream;
- }
-
- public bool HasRemaining() {
- return (stream.Length - stream.Position) > 0;
- }
-
- public long Position {
- get => stream.Position;
- set => stream.Position = value;
- }
-
- public void WriteBytes(byte[] value) {
- stream.Write(value, 0, value.Length);
- }
-
- public void WriteByte(byte value) {
- stream.WriteByte(value);
- }
-
- public void WriteUShort(ushort value) {
- stream.WriteByte((byte)(value >> 8));
- stream.WriteByte((byte)value);
- }
-
- public void WriteUInt(uint value) {
- stream.WriteByte((byte)(value >> 24));
- stream.WriteByte((byte)(value >> 16));
- stream.WriteByte((byte)(value >> 8));
- stream.WriteByte((byte)value);
- }
-
- public void WriteULong(ulong value) {
- WriteUInt((uint)(value >> 32));
- WriteUInt((uint)value);
- }
-
- public void WriteSByte(sbyte value) {
- stream.WriteByte((byte)value);
- }
-
- public void WriteShort(short value) {
- WriteUShort((ushort)value);
- }
-
- public void WriteInt(int value) {
- WriteUInt((uint)value);
- }
-
- public void WriteFloat(float value) {
- unsafe {
- WriteInt(*((int*)&value));
- }
- }
-
- public void WriteLong(long value) {
- WriteULong((ulong)value);
- }
-
- public void WriteDouble(double value) {
- WriteLong(BitConverter.DoubleToInt64Bits(value));
- }
-
- public byte[] ReadBytes(int length) {
- CheckRemaining(length);
- byte[] result = new byte[length];
- stream.Read(result, 0, length);
- return result;
- }
-
- public byte ReadByte() {
- CheckRemaining(1);
- return Convert.ToByte(stream.ReadByte());
- }
-
- public ushort ReadUShort() {
- CheckRemaining(2);
- return (ushort)(stream.ReadByte() << 8 | stream.ReadByte());
- }
-
- public uint ReadUInt() {
- CheckRemaining(4);
- return (uint)(stream.ReadByte() << 24
- | stream.ReadByte() << 16
- | stream.ReadByte() << 8
- | stream.ReadByte());
- }
-
- public ulong ReadULong() {
- return (ulong)ReadUInt() << 32 | (ulong)ReadUInt();
- }
-
- public sbyte ReadSByte() {
- return (sbyte)ReadByte();
- }
-
- public short ReadShort() {
- return (short)ReadUShort();
- }
-
- public int ReadInt() {
- return (int)ReadUInt();
- }
-
- public float ReadFloat() {
- unsafe {
- int value = ReadInt();
- return *((float*)&value);
- }
- }
-
- public long ReadLong() {
- return (long)ReadULong();
- }
-
- public double ReadDouble() {
- return BitConverter.Int64BitsToDouble(ReadLong());
- }
-
- private void CheckRemaining(int length) {
- if (stream.Length - stream.Position < length) {
- throw new StreamUnderflowException();
- }
- }
-}
-
-// Contains loading, initialization code,
-// and the FFI Function declarations in a com.sun.jna.Library.
-
-
-// This is an implementation detail which will be called internally by the public API.
-static class _UniFFILib {
- static _UniFFILib() {
- _UniFFILib.uniffiCheckContractApiVersion();
- _UniFFILib.uniffiCheckApiChecksums();
-
- }
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_bitvec(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitVecSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_clone(BitVecSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitVecSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load(RustBuffer @data,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitVecSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new(ulong @size,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw(BitVecSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals(BitVecSafeHandle @ptr,BitVecSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill(BitVecSafeHandle @ptr,sbyte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get(BitVecSafeHandle @ptr,ulong @index,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len(BitVecSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set(BitVecSafeHandle @ptr,ulong @index,sbyte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_bitmap(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitmapSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_clone(BitmapSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitmapSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_load(ulong @width,ulong @height,RustBuffer @data,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitmapSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new(ulong @width,ulong @height,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BitmapSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw(BitmapSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals(BitmapSafeHandle @ptr,BitmapSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill(BitmapSafeHandle @ptr,sbyte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get(BitmapSafeHandle @ptr,ulong @x,ulong @y,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height(BitmapSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set(BitmapSafeHandle @ptr,ulong @x,ulong @y,sbyte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width(BitmapSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BrightnessGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_clone(BrightnessGridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BrightnessGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_load(ulong @width,ulong @height,RustBuffer @data,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern BrightnessGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new(ulong @width,ulong @height,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw(BrightnessGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals(BrightnessGridSafeHandle @ptr,BrightnessGridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill(BrightnessGridSafeHandle @ptr,byte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern byte uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get(BrightnessGridSafeHandle @ptr,ulong @x,ulong @y,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height(BrightnessGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set(BrightnessGridSafeHandle @ptr,ulong @x,ulong @y,byte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width(BrightnessGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_chargrid(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CharGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone(CharGridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CharGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load(RustBuffer @data,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CharGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_new(ulong @width,ulong @height,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string(CharGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals(CharGridSafeHandle @ptr,CharGridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill(CharGridSafeHandle @ptr,RustBuffer @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get(CharGridSafeHandle @ptr,ulong @x,ulong @y,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col(CharGridSafeHandle @ptr,ulong @x,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row(CharGridSafeHandle @ptr,ulong @y,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height(CharGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set(CharGridSafeHandle @ptr,ulong @x,ulong @y,RustBuffer @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col(CharGridSafeHandle @ptr,ulong @x,RustBuffer @col,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row(CharGridSafeHandle @ptr,ulong @y,RustBuffer @row,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern Cp437GridSafeHandle uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437(CharGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width(CharGridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_command(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear(ulong @offset,BitVecSafeHandle @bitmap,RustBuffer @compression,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_and(ulong @offset,BitVecSafeHandle @bitmap,RustBuffer @compression,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_or(ulong @offset,BitVecSafeHandle @bitmap,RustBuffer @compression,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_win(ulong @offsetX,ulong @offsetY,BitmapSafeHandle @bitmap,RustBuffer @compression,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_xor(ulong @offset,BitVecSafeHandle @bitmap,RustBuffer @compression,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_brightness(byte @brightness,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_char_brightness(ulong @offsetX,ulong @offsetY,BrightnessGridSafeHandle @grid,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_clear(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_clone(CommandSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_cp437_data(ulong @offsetX,ulong @offsetY,Cp437GridSafeHandle @grid,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_fade_out(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_hard_reset(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CommandSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_command_utf8_data(ulong @offsetX,ulong @offsetY,CharGridSafeHandle @grid,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_command_equals(CommandSafeHandle @ptr,CommandSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_connection(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ConnectionSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new(RustBuffer @host,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ConnectionSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new_fake(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_connection_send(ConnectionSafeHandle @ptr,CommandSafeHandle @command,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_free_cp437grid(
- IntPtr ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern Cp437GridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_clone(Cp437GridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern Cp437GridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_load(ulong @width,ulong @height,RustBuffer @data,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern Cp437GridSafeHandle uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new(ulong @width,ulong @height,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw(Cp437GridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals(Cp437GridSafeHandle @ptr,Cp437GridSafeHandle @other,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill(Cp437GridSafeHandle @ptr,byte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern byte uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get(Cp437GridSafeHandle @ptr,ulong @x,ulong @y,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height(Cp437GridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set(Cp437GridSafeHandle @ptr,ulong @x,ulong @y,byte @value,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern CharGridSafeHandle uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8(Cp437GridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width(Cp437GridSafeHandle @ptr,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_func_get_constants(ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_alloc(int @size,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_from_bytes(ForeignBytes @bytes,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rustbuffer_free(RustBuffer @buf,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_reserve(RustBuffer @buf,int @additional,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_continuation_callback_set(IntPtr @callback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u8(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u8(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_u8(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern byte ffi_servicepoint_binding_uniffi_rust_future_complete_u8(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i8(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i8(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_i8(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern sbyte ffi_servicepoint_binding_uniffi_rust_future_complete_i8(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u16(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u16(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_u16(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort ffi_servicepoint_binding_uniffi_rust_future_complete_u16(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i16(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i16(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_i16(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern short ffi_servicepoint_binding_uniffi_rust_future_complete_i16(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u32(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_u32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern uint ffi_servicepoint_binding_uniffi_rust_future_complete_u32(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i32(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_i32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern int ffi_servicepoint_binding_uniffi_rust_future_complete_i32(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u64(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_u64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ulong ffi_servicepoint_binding_uniffi_rust_future_complete_u64(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i64(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_i64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern long ffi_servicepoint_binding_uniffi_rust_future_complete_i64(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_f32(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_f32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_f32(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern float ffi_servicepoint_binding_uniffi_rust_future_complete_f32(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_f64(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_f64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_f64(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern double ffi_servicepoint_binding_uniffi_rust_future_complete_f64(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_pointer(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_pointer(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_pointer(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern SafeHandle ffi_servicepoint_binding_uniffi_rust_future_complete_pointer(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_rust_buffer(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_rust_buffer(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_rust_buffer(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern RustBuffer ffi_servicepoint_binding_uniffi_rust_future_complete_rust_buffer(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_void(IntPtr @handle,IntPtr @uniffiCallback
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_void(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_free_void(IntPtr @handle
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern void ffi_servicepoint_binding_uniffi_rust_future_complete_void(IntPtr @handle,ref RustCallStatus _uniffi_out_err
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_func_get_constants(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_command_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_connection_send(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_and(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_or(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_win(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_xor(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new_fake(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new(
- );
-
- [DllImport("servicepoint_binding_uniffi")]
- public static extern uint ffi_servicepoint_binding_uniffi_uniffi_contract_version(
- );
-
-
-
- static void uniffiCheckContractApiVersion() {
- var scaffolding_contract_version = _UniFFILib.ffi_servicepoint_binding_uniffi_uniffi_contract_version();
- if (24 != scaffolding_contract_version) {
- throw new UniffiContractVersionException($"ServicePoint: uniffi bindings expected version `24`, library returned `{scaffolding_contract_version}`");
- }
- }
-
- static void uniffiCheckApiChecksums() {
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_func_get_constants();
- if (checksum != 41584) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_func_get_constants` checksum `41584`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw();
- if (checksum != 12617) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw` checksum `12617`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals();
- if (checksum != 1191) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals` checksum `1191`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill();
- if (checksum != 12255) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill` checksum `12255`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get();
- if (checksum != 43835) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get` checksum `43835`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len();
- if (checksum != 22196) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len` checksum `22196`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set();
- if (checksum != 16307) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set` checksum `16307`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw();
- if (checksum != 3467) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw` checksum `3467`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals();
- if (checksum != 420) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals` checksum `420`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill();
- if (checksum != 43887) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill` checksum `43887`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get();
- if (checksum != 61136) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get` checksum `61136`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height();
- if (checksum != 44991) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height` checksum `44991`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set();
- if (checksum != 25290) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set` checksum `25290`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width();
- if (checksum != 30837) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width` checksum `30837`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw();
- if (checksum != 28155) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw` checksum `28155`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals();
- if (checksum != 13314) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals` checksum `13314`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill();
- if (checksum != 63376) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill` checksum `63376`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get();
- if (checksum != 28736) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get` checksum `28736`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height();
- if (checksum != 39528) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height` checksum `39528`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set();
- if (checksum != 6330) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set` checksum `6330`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width();
- if (checksum != 26384) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width` checksum `26384`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string();
- if (checksum != 46581) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string` checksum `46581`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals();
- if (checksum != 17533) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals` checksum `17533`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill();
- if (checksum != 56996) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill` checksum `56996`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get();
- if (checksum != 1334) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get` checksum `1334`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col();
- if (checksum != 64158) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col` checksum `64158`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row();
- if (checksum != 39411) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row` checksum `39411`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height();
- if (checksum != 13068) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height` checksum `13068`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set();
- if (checksum != 64815) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set` checksum `64815`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col();
- if (checksum != 43727) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col` checksum `43727`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row();
- if (checksum != 19756) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row` checksum `19756`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437();
- if (checksum != 19261) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437` checksum `19261`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width();
- if (checksum != 48963) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width` checksum `48963`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_command_equals();
- if (checksum != 20763) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_command_equals` checksum `20763`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_connection_send();
- if (checksum != 23796) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_connection_send` checksum `23796`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw();
- if (checksum != 50937) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw` checksum `50937`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals();
- if (checksum != 21544) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals` checksum `21544`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill();
- if (checksum != 46422) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill` checksum `46422`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get();
- if (checksum != 1945) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get` checksum `1945`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height();
- if (checksum != 45951) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height` checksum `45951`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set();
- if (checksum != 8371) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set` checksum `8371`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8();
- if (checksum != 21516) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8` checksum `21516`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width();
- if (checksum != 36872) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width` checksum `36872`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone();
- if (checksum != 123) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone` checksum `123`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load();
- if (checksum != 48913) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load` checksum `48913`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new();
- if (checksum != 11865) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new` checksum `11865`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone();
- if (checksum != 57298) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone` checksum `57298`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load();
- if (checksum != 24109) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load` checksum `24109`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new();
- if (checksum != 49832) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new` checksum `49832`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized();
- if (checksum != 63762) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized` checksum `63762`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone();
- if (checksum != 33422) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone` checksum `33422`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load();
- if (checksum != 24788) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load` checksum `24788`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new();
- if (checksum != 4979) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new` checksum `4979`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone();
- if (checksum != 61241) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone` checksum `61241`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load();
- if (checksum != 47815) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load` checksum `47815`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new();
- if (checksum != 13303) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new` checksum `13303`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear();
- if (checksum != 18079) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear` checksum `18079`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_and();
- if (checksum != 18147) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_and` checksum `18147`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_or();
- if (checksum != 44912) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_or` checksum `44912`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_win();
- if (checksum != 24563) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_win` checksum `24563`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_xor();
- if (checksum != 54278) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_xor` checksum `54278`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness();
- if (checksum != 11291) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness` checksum `11291`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness();
- if (checksum != 29467) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness` checksum `29467`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear();
- if (checksum != 11035) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear` checksum `11035`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone();
- if (checksum != 42249) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone` checksum `42249`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data();
- if (checksum != 33157) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data` checksum `33157`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out();
- if (checksum != 49231) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out` checksum `49231`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset();
- if (checksum != 62130) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset` checksum `62130`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data();
- if (checksum != 2263) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data` checksum `2263`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new();
- if (checksum != 30445) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new` checksum `30445`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new_fake();
- if (checksum != 54331) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new_fake` checksum `54331`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone();
- if (checksum != 28173) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone` checksum `28173`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load();
- if (checksum != 62136) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load` checksum `62136`, library returned `{checksum}`");
- }
- }
- {
- var checksum = _UniFFILib.uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new();
- if (checksum != 17350) {
- throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new` checksum `17350`, library returned `{checksum}`");
- }
- }
- }
-}
-
-// Public interface members begin here.
-
-#pragma warning disable 8625
-
-
-
-
-class FfiConverterUInt8: FfiConverter {
- public static FfiConverterUInt8 INSTANCE = new FfiConverterUInt8();
-
- public override byte Lift(byte value) {
- return value;
- }
-
- public override byte Read(BigEndianStream stream) {
- return stream.ReadByte();
- }
-
- public override byte Lower(byte value) {
- return value;
- }
-
- public override int AllocationSize(byte value) {
- return 1;
- }
-
- public override void Write(byte value, BigEndianStream stream) {
- stream.WriteByte(value);
- }
-}
-
-
-
-class FfiConverterUInt64: FfiConverter {
- public static FfiConverterUInt64 INSTANCE = new FfiConverterUInt64();
-
- public override ulong Lift(ulong value) {
- return value;
- }
-
- public override ulong Read(BigEndianStream stream) {
- return stream.ReadULong();
- }
-
- public override ulong Lower(ulong value) {
- return value;
- }
-
- public override int AllocationSize(ulong value) {
- return 8;
- }
-
- public override void Write(ulong value, BigEndianStream stream) {
- stream.WriteULong(value);
- }
-}
-
-
-
-class FfiConverterBoolean: FfiConverter {
- public static FfiConverterBoolean INSTANCE = new FfiConverterBoolean();
-
- public override bool Lift(sbyte value) {
- return value != 0;
- }
-
- public override bool Read(BigEndianStream stream) {
- return Lift(stream.ReadSByte());
- }
-
- public override sbyte Lower(bool value) {
- return value ? (sbyte)1 : (sbyte)0;
- }
-
- public override int AllocationSize(bool value) {
- return (sbyte)1;
- }
-
- public override void Write(bool value, BigEndianStream stream) {
- stream.WriteSByte(Lower(value));
- }
-}
-
-
-
-class FfiConverterString: FfiConverter {
- public static FfiConverterString INSTANCE = new FfiConverterString();
-
- // Note: we don't inherit from FfiConverterRustBuffer, because we use a
- // special encoding when lowering/lifting. We can use `RustBuffer.len` to
- // store our length and avoid writing it out to the buffer.
- public override string Lift(RustBuffer value) {
- try {
- var bytes = value.AsStream().ReadBytes(value.len);
- return System.Text.Encoding.UTF8.GetString(bytes);
- } finally {
- RustBuffer.Free(value);
- }
- }
-
- public override string Read(BigEndianStream stream) {
- var length = stream.ReadInt();
- var bytes = stream.ReadBytes(length);
- return System.Text.Encoding.UTF8.GetString(bytes);
- }
-
- public override RustBuffer Lower(string value) {
- var bytes = System.Text.Encoding.UTF8.GetBytes(value);
- var rbuf = RustBuffer.Alloc(bytes.Length);
- rbuf.AsWriteableStream().WriteBytes(bytes);
- return rbuf;
- }
-
- // TODO(CS)
- // We aren't sure exactly how many bytes our string will be once it's UTF-8
- // encoded. Allocate 3 bytes per unicode codepoint which will always be
- // enough.
- public override int AllocationSize(string value) {
- const int sizeForLength = 4;
- var sizeForString = value.Length * 3;
- return sizeForLength + sizeForString;
- }
-
- public override void Write(string value, BigEndianStream stream) {
- var bytes = System.Text.Encoding.UTF8.GetBytes(value);
- stream.WriteInt(bytes.Length);
- stream.WriteBytes(bytes);
- }
-}
-
-
-
-
-class FfiConverterByteArray: FfiConverterRustBuffer {
- public static FfiConverterByteArray INSTANCE = new FfiConverterByteArray();
-
- public override byte[] Read(BigEndianStream stream) {
- var length = stream.ReadInt();
- return stream.ReadBytes(length);
- }
-
- public override int AllocationSize(byte[] value) {
- return 4 + value.Length;
- }
-
- public override void Write(byte[] value, BigEndianStream stream) {
- stream.WriteInt(value.Length);
- stream.WriteBytes(value);
- }
-}
-
-
-
-
-// `SafeHandle` implements the semantics outlined below, i.e. its thread safe, and the dispose
-// method will only be called once, once all outstanding native calls have completed.
-// https://github.com/mozilla/uniffi-rs/blob/0dc031132d9493ca812c3af6e7dd60ad2ea95bf0/uniffi_bindgen/src/bindings/kotlin/templates/ObjectRuntime.kt#L31
-// https://learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.criticalhandle
-
-public abstract class FFIObject: IDisposable where THandle : FFISafeHandle {
- private THandle handle;
-
- public FFIObject(THandle handle) {
- this.handle = handle;
- }
-
- public THandle GetHandle() {
- return handle;
- }
-
- public void Dispose() {
- handle.Dispose();
- }
-}
-
-public abstract class FFISafeHandle: SafeHandle {
- public FFISafeHandle(): base(new IntPtr(0), true) {
- }
-
- public FFISafeHandle(IntPtr pointer): this() {
- this.SetHandle(pointer);
- }
-
- public override bool IsInvalid {
- get {
- return handle.ToInt64() == 0;
- }
- }
-
- // TODO(CS) this completely breaks any guarantees offered by SafeHandle.. Extracting
- // raw value from SafeHandle puts responsiblity on the consumer of this function to
- // ensure that SafeHandle outlives the stream, and anyone who might have read the raw
- // value from the stream and are holding onto it. Otherwise, the result might be a use
- // after free, or free while method calls are still in flight.
- //
- // This is also relevant for Kotlin.
- //
- public IntPtr DangerousGetRawFfiValue() {
- return handle;
- }
-}
-
-static class FFIObjectUtil {
- public static void DisposeAll(params Object?[] list) {
- foreach (var obj in list) {
- Dispose(obj);
- }
- }
-
- // Dispose is implemented by recursive type inspection at runtime. This is because
- // generating correct Dispose calls for recursive complex types, e.g. List>
- // is quite cumbersome.
- private static void Dispose(dynamic? obj) {
- if (obj == null) {
- return;
- }
-
- if (obj is IDisposable disposable) {
- disposable.Dispose();
- return;
- }
-
- var type = obj.GetType();
- if (type != null) {
- if (type.IsGenericType) {
- if (type.GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))) {
- foreach (var value in obj) {
- Dispose(value);
- }
- } else if (type.GetGenericTypeDefinition().IsAssignableFrom(typeof(Dictionary<,>))) {
- foreach (var value in obj.Values) {
- Dispose(value);
- }
- }
- }
- }
- }
-}
-public interface IBitVec {
-
- byte[] CopyRaw();
-
- bool Equals(BitVec @other);
-
- void Fill(bool @value);
-
- bool Get(ulong @index);
-
- ulong Len();
-
- void Set(ulong @index, bool @value);
-
-}
-
-public class BitVecSafeHandle: FFISafeHandle {
- public BitVecSafeHandle(): base() {
- }
- public BitVecSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_bitvec(this.handle, ref status);
- });
- return true;
- }
-}
-public class BitVec: FFIObject, IBitVec {
- public BitVec(BitVecSafeHandle pointer): base(pointer) {}
- public BitVec(ulong @size) :
- this(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new(FfiConverterUInt64.INSTANCE.Lower(@size), ref _status)
-)) {}
-
-
- public byte[] CopyRaw() {
- return FfiConverterByteArray.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw(this.GetHandle(), ref _status)
-));
- }
-
- public bool Equals(BitVec @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals(this.GetHandle(), FfiConverterTypeBitVec.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public void Fill(bool @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill(this.GetHandle(), FfiConverterBoolean.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public bool Get(ulong @index) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@index), ref _status)
-));
- }
-
- public ulong Len() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len(this.GetHandle(), ref _status)
-));
- }
-
- public void Set(ulong @index, bool @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@index), FfiConverterBoolean.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
-
-
- public static BitVec Clone(BitVec @other) {
- return new BitVec(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_clone(FfiConverterTypeBitVec.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static BitVec Load(byte[] @data) {
- return new BitVec(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load(FfiConverterByteArray.INSTANCE.Lower(@data), ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeBitVec: FfiConverter {
- public static FfiConverterTypeBitVec INSTANCE = new FfiConverterTypeBitVec();
-
- public override BitVecSafeHandle Lower(BitVec value) {
- return value.GetHandle();
- }
-
- public override BitVec Lift(BitVecSafeHandle value) {
- return new BitVec(value);
- }
-
- public override BitVec Read(BigEndianStream stream) {
- return Lift(new BitVecSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(BitVec value) {
- return 8;
- }
-
- public override void Write(BitVec value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface IBitmap {
-
- byte[] CopyRaw();
-
- bool Equals(Bitmap @other);
-
- void Fill(bool @value);
-
- bool Get(ulong @x, ulong @y);
-
- ulong Height();
-
- void Set(ulong @x, ulong @y, bool @value);
-
- ulong Width();
-
-}
-
-public class BitmapSafeHandle: FFISafeHandle {
- public BitmapSafeHandle(): base() {
- }
- public BitmapSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_bitmap(this.handle, ref status);
- });
- return true;
- }
-}
-public class Bitmap: FFIObject, IBitmap {
- public Bitmap(BitmapSafeHandle pointer): base(pointer) {}
- public Bitmap(ulong @width, ulong @height) :
- this(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status)
-)) {}
-
-
- public byte[] CopyRaw() {
- return FfiConverterByteArray.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw(this.GetHandle(), ref _status)
-));
- }
-
- public bool Equals(Bitmap @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals(this.GetHandle(), FfiConverterTypeBitmap.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public void Fill(bool @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill(this.GetHandle(), FfiConverterBoolean.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public bool Get(ulong @x, ulong @y) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), ref _status)
-));
- }
-
- public ulong Height() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height(this.GetHandle(), ref _status)
-));
- }
-
- public void Set(ulong @x, ulong @y, bool @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterBoolean.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public ulong Width() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width(this.GetHandle(), ref _status)
-));
- }
-
-
-
- public static Bitmap Clone(Bitmap @other) {
- return new Bitmap(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_clone(FfiConverterTypeBitmap.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static Bitmap Load(ulong @width, ulong @height, byte[] @data) {
- return new Bitmap(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_load(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), FfiConverterByteArray.INSTANCE.Lower(@data), ref _status)
-));
- }
-
- public static Bitmap NewMaxSized() {
- return new Bitmap(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized( ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeBitmap: FfiConverter {
- public static FfiConverterTypeBitmap INSTANCE = new FfiConverterTypeBitmap();
-
- public override BitmapSafeHandle Lower(Bitmap value) {
- return value.GetHandle();
- }
-
- public override Bitmap Lift(BitmapSafeHandle value) {
- return new Bitmap(value);
- }
-
- public override Bitmap Read(BigEndianStream stream) {
- return Lift(new BitmapSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(Bitmap value) {
- return 8;
- }
-
- public override void Write(Bitmap value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface IBrightnessGrid {
-
- byte[] CopyRaw();
-
- bool Equals(BrightnessGrid @other);
-
- void Fill(byte @value);
-
- byte Get(ulong @x, ulong @y);
-
- ulong Height();
-
- void Set(ulong @x, ulong @y, byte @value);
-
- ulong Width();
-
-}
-
-public class BrightnessGridSafeHandle: FFISafeHandle {
- public BrightnessGridSafeHandle(): base() {
- }
- public BrightnessGridSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid(this.handle, ref status);
- });
- return true;
- }
-}
-public class BrightnessGrid: FFIObject, IBrightnessGrid {
- public BrightnessGrid(BrightnessGridSafeHandle pointer): base(pointer) {}
- public BrightnessGrid(ulong @width, ulong @height) :
- this(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status)
-)) {}
-
-
- public byte[] CopyRaw() {
- return FfiConverterByteArray.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw(this.GetHandle(), ref _status)
-));
- }
-
- public bool Equals(BrightnessGrid @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals(this.GetHandle(), FfiConverterTypeBrightnessGrid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public void Fill(byte @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill(this.GetHandle(), FfiConverterUInt8.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public byte Get(ulong @x, ulong @y) {
- return FfiConverterUInt8.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), ref _status)
-));
- }
-
- public ulong Height() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height(this.GetHandle(), ref _status)
-));
- }
-
- public void Set(ulong @x, ulong @y, byte @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterUInt8.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public ulong Width() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width(this.GetHandle(), ref _status)
-));
- }
-
-
-
- public static BrightnessGrid Clone(BrightnessGrid @other) {
- return new BrightnessGrid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_clone(FfiConverterTypeBrightnessGrid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static BrightnessGrid Load(ulong @width, ulong @height, byte[] @data) {
- return new BrightnessGrid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_load(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), FfiConverterByteArray.INSTANCE.Lower(@data), ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeBrightnessGrid: FfiConverter {
- public static FfiConverterTypeBrightnessGrid INSTANCE = new FfiConverterTypeBrightnessGrid();
-
- public override BrightnessGridSafeHandle Lower(BrightnessGrid value) {
- return value.GetHandle();
- }
-
- public override BrightnessGrid Lift(BrightnessGridSafeHandle value) {
- return new BrightnessGrid(value);
- }
-
- public override BrightnessGrid Read(BigEndianStream stream) {
- return Lift(new BrightnessGridSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(BrightnessGrid value) {
- return 8;
- }
-
- public override void Write(BrightnessGrid value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface ICharGrid {
-
- String AsString();
-
- bool Equals(CharGrid @other);
-
- ///
- void Fill(String @value);
-
- String Get(ulong @x, ulong @y);
-
- ///
- String GetCol(ulong @x);
-
- ///
- String GetRow(ulong @y);
-
- ulong Height();
-
- ///
- void Set(ulong @x, ulong @y, String @value);
-
- ///
- void SetCol(ulong @x, String @col);
-
- ///
- void SetRow(ulong @y, String @row);
-
- Cp437Grid ToCp437();
-
- ulong Width();
-
-}
-
-public class CharGridSafeHandle: FFISafeHandle {
- public CharGridSafeHandle(): base() {
- }
- public CharGridSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_chargrid(this.handle, ref status);
- });
- return true;
- }
-}
-public class CharGrid: FFIObject, ICharGrid {
- public CharGrid(CharGridSafeHandle pointer): base(pointer) {}
- public CharGrid(ulong @width, ulong @height) :
- this(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status)
-)) {}
-
-
- public String AsString() {
- return FfiConverterString.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string(this.GetHandle(), ref _status)
-));
- }
-
- public bool Equals(CharGrid @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals(this.GetHandle(), FfiConverterTypeCharGrid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- ///
- public void Fill(String @value) {
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill(this.GetHandle(), FfiConverterString.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public String Get(ulong @x, ulong @y) {
- return FfiConverterString.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), ref _status)
-));
- }
-
- ///
- public String GetCol(ulong @x) {
- return FfiConverterString.INSTANCE.Lift(
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), ref _status)
-));
- }
-
- ///
- public String GetRow(ulong @y) {
- return FfiConverterString.INSTANCE.Lift(
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@y), ref _status)
-));
- }
-
- public ulong Height() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height(this.GetHandle(), ref _status)
-));
- }
-
- ///
- public void Set(ulong @x, ulong @y, String @value) {
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterString.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- ///
- public void SetCol(ulong @x, String @col) {
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterString.INSTANCE.Lower(@col), ref _status)
-);
- }
-
-
- ///
- public void SetRow(ulong @y, String @row) {
- _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterString.INSTANCE.Lower(@row), ref _status)
-);
- }
-
-
- public Cp437Grid ToCp437() {
- return FfiConverterTypeCp437Grid.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437(this.GetHandle(), ref _status)
-));
- }
-
- public ulong Width() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width(this.GetHandle(), ref _status)
-));
- }
-
-
-
- public static CharGrid Clone(CharGrid @other) {
- return new CharGrid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone(FfiConverterTypeCharGrid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static CharGrid Load(String @data) {
- return new CharGrid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load(FfiConverterString.INSTANCE.Lower(@data), ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeCharGrid: FfiConverter {
- public static FfiConverterTypeCharGrid INSTANCE = new FfiConverterTypeCharGrid();
-
- public override CharGridSafeHandle Lower(CharGrid value) {
- return value.GetHandle();
- }
-
- public override CharGrid Lift(CharGridSafeHandle value) {
- return new CharGrid(value);
- }
-
- public override CharGrid Read(BigEndianStream stream) {
- return Lift(new CharGridSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(CharGrid value) {
- return 8;
- }
-
- public override void Write(CharGrid value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface ICommand {
-
- bool Equals(Command @other);
-
-}
-
-public class CommandSafeHandle: FFISafeHandle {
- public CommandSafeHandle(): base() {
- }
- public CommandSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_command(this.handle, ref status);
- });
- return true;
- }
-}
-public class Command: FFIObject, ICommand {
- public Command(CommandSafeHandle pointer): base(pointer) {}
-
-
- public bool Equals(Command @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_command_equals(this.GetHandle(), FfiConverterTypeCommand.INSTANCE.Lower(@other), ref _status)
-));
- }
-
-
-
- public static Command BitmapLinear(ulong @offset, BitVec @bitmap, CompressionCode @compression) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear(FfiConverterUInt64.INSTANCE.Lower(@offset), FfiConverterTypeBitVec.INSTANCE.Lower(@bitmap), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), ref _status)
-));
- }
-
- public static Command BitmapLinearAnd(ulong @offset, BitVec @bitmap, CompressionCode @compression) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_and(FfiConverterUInt64.INSTANCE.Lower(@offset), FfiConverterTypeBitVec.INSTANCE.Lower(@bitmap), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), ref _status)
-));
- }
-
- public static Command BitmapLinearOr(ulong @offset, BitVec @bitmap, CompressionCode @compression) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_or(FfiConverterUInt64.INSTANCE.Lower(@offset), FfiConverterTypeBitVec.INSTANCE.Lower(@bitmap), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), ref _status)
-));
- }
-
- public static Command BitmapLinearWin(ulong @offsetX, ulong @offsetY, Bitmap @bitmap, CompressionCode @compression) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_win(FfiConverterUInt64.INSTANCE.Lower(@offsetX), FfiConverterUInt64.INSTANCE.Lower(@offsetY), FfiConverterTypeBitmap.INSTANCE.Lower(@bitmap), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), ref _status)
-));
- }
-
- public static Command BitmapLinearXor(ulong @offset, BitVec @bitmap, CompressionCode @compression) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_xor(FfiConverterUInt64.INSTANCE.Lower(@offset), FfiConverterTypeBitVec.INSTANCE.Lower(@bitmap), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), ref _status)
-));
- }
-
- ///
- public static Command Brightness(byte @brightness) {
- return new Command(
- _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_brightness(FfiConverterUInt8.INSTANCE.Lower(@brightness), ref _status)
-));
- }
-
- public static Command CharBrightness(ulong @offsetX, ulong @offsetY, BrightnessGrid @grid) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_char_brightness(FfiConverterUInt64.INSTANCE.Lower(@offsetX), FfiConverterUInt64.INSTANCE.Lower(@offsetY), FfiConverterTypeBrightnessGrid.INSTANCE.Lower(@grid), ref _status)
-));
- }
-
- public static Command Clear() {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_clear( ref _status)
-));
- }
-
- public static Command Clone(Command @other) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_clone(FfiConverterTypeCommand.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static Command Cp437Data(ulong @offsetX, ulong @offsetY, Cp437Grid @grid) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_cp437_data(FfiConverterUInt64.INSTANCE.Lower(@offsetX), FfiConverterUInt64.INSTANCE.Lower(@offsetY), FfiConverterTypeCp437Grid.INSTANCE.Lower(@grid), ref _status)
-));
- }
-
- public static Command FadeOut() {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_fade_out( ref _status)
-));
- }
-
- public static Command HardReset() {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_hard_reset( ref _status)
-));
- }
-
- public static Command Utf8Data(ulong @offsetX, ulong @offsetY, CharGrid @grid) {
- return new Command(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_utf8_data(FfiConverterUInt64.INSTANCE.Lower(@offsetX), FfiConverterUInt64.INSTANCE.Lower(@offsetY), FfiConverterTypeCharGrid.INSTANCE.Lower(@grid), ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeCommand: FfiConverter {
- public static FfiConverterTypeCommand INSTANCE = new FfiConverterTypeCommand();
-
- public override CommandSafeHandle Lower(Command value) {
- return value.GetHandle();
- }
-
- public override Command Lift(CommandSafeHandle value) {
- return new Command(value);
- }
-
- public override Command Read(BigEndianStream stream) {
- return Lift(new CommandSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(Command value) {
- return 8;
- }
-
- public override void Write(Command value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface IConnection {
-
- ///
- void Send(Command @command);
-
-}
-
-public class ConnectionSafeHandle: FFISafeHandle {
- public ConnectionSafeHandle(): base() {
- }
- public ConnectionSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_connection(this.handle, ref status);
- });
- return true;
- }
-}
-public class Connection: FFIObject, IConnection {
- public Connection(ConnectionSafeHandle pointer): base(pointer) {}
- public Connection(String @host) :
- this(
- _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new(FfiConverterString.INSTANCE.Lower(@host), ref _status)
-)) {}
-
-
- ///
- public void Send(Command @command) {
- _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointException.INSTANCE, (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_connection_send(this.GetHandle(), FfiConverterTypeCommand.INSTANCE.Lower(@command), ref _status)
-);
- }
-
-
-
-
- public static Connection NewFake() {
- return new Connection(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new_fake( ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeConnection: FfiConverter {
- public static FfiConverterTypeConnection INSTANCE = new FfiConverterTypeConnection();
-
- public override ConnectionSafeHandle Lower(Connection value) {
- return value.GetHandle();
- }
-
- public override Connection Lift(ConnectionSafeHandle value) {
- return new Connection(value);
- }
-
- public override Connection Read(BigEndianStream stream) {
- return Lift(new ConnectionSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(Connection value) {
- return 8;
- }
-
- public override void Write(Connection value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public interface ICp437Grid {
-
- byte[] CopyRaw();
-
- bool Equals(Cp437Grid @other);
-
- void Fill(byte @value);
-
- byte Get(ulong @x, ulong @y);
-
- ulong Height();
-
- void Set(ulong @x, ulong @y, byte @value);
-
- CharGrid ToUtf8();
-
- ulong Width();
-
-}
-
-public class Cp437GridSafeHandle: FFISafeHandle {
- public Cp437GridSafeHandle(): base() {
- }
- public Cp437GridSafeHandle(IntPtr pointer): base(pointer) {
- }
- override protected bool ReleaseHandle() {
- _UniffiHelpers.RustCall((ref RustCallStatus status) => {
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_cp437grid(this.handle, ref status);
- });
- return true;
- }
-}
-public class Cp437Grid: FFIObject, ICp437Grid {
- public Cp437Grid(Cp437GridSafeHandle pointer): base(pointer) {}
- public Cp437Grid(ulong @width, ulong @height) :
- this(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status)
-)) {}
-
-
- public byte[] CopyRaw() {
- return FfiConverterByteArray.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw(this.GetHandle(), ref _status)
-));
- }
-
- public bool Equals(Cp437Grid @other) {
- return FfiConverterBoolean.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals(this.GetHandle(), FfiConverterTypeCp437Grid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public void Fill(byte @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill(this.GetHandle(), FfiConverterUInt8.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public byte Get(ulong @x, ulong @y) {
- return FfiConverterUInt8.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), ref _status)
-));
- }
-
- public ulong Height() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height(this.GetHandle(), ref _status)
-));
- }
-
- public void Set(ulong @x, ulong @y, byte @value) {
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set(this.GetHandle(), FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterUInt8.INSTANCE.Lower(@value), ref _status)
-);
- }
-
-
- public CharGrid ToUtf8() {
- return FfiConverterTypeCharGrid.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8(this.GetHandle(), ref _status)
-));
- }
-
- public ulong Width() {
- return FfiConverterUInt64.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width(this.GetHandle(), ref _status)
-));
- }
-
-
-
- public static Cp437Grid Clone(Cp437Grid @other) {
- return new Cp437Grid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_clone(FfiConverterTypeCp437Grid.INSTANCE.Lower(@other), ref _status)
-));
- }
-
- public static Cp437Grid Load(ulong @width, ulong @height, byte[] @data) {
- return new Cp437Grid(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_load(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), FfiConverterByteArray.INSTANCE.Lower(@data), ref _status)
-));
- }
-
-
-}
-
-class FfiConverterTypeCp437Grid: FfiConverter {
- public static FfiConverterTypeCp437Grid INSTANCE = new FfiConverterTypeCp437Grid();
-
- public override Cp437GridSafeHandle Lower(Cp437Grid value) {
- return value.GetHandle();
- }
-
- public override Cp437Grid Lift(Cp437GridSafeHandle value) {
- return new Cp437Grid(value);
- }
-
- public override Cp437Grid Read(BigEndianStream stream) {
- return Lift(new Cp437GridSafeHandle(new IntPtr(stream.ReadLong())));
- }
-
- public override int AllocationSize(Cp437Grid value) {
- return 8;
- }
-
- public override void Write(Cp437Grid value, BigEndianStream stream) {
- stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64());
- }
-}
-
-
-
-public record Constants (
- ulong @tileSize,
- ulong @tileWidth,
- ulong @tileHeight,
- ulong @pixelWidth,
- ulong @pixelHeight,
- ulong @pixelCount
-) {
-}
-
-class FfiConverterTypeConstants: FfiConverterRustBuffer {
- public static FfiConverterTypeConstants INSTANCE = new FfiConverterTypeConstants();
-
- public override Constants Read(BigEndianStream stream) {
- return new Constants(
- @tileSize: FfiConverterUInt64.INSTANCE.Read(stream),
- @tileWidth: FfiConverterUInt64.INSTANCE.Read(stream),
- @tileHeight: FfiConverterUInt64.INSTANCE.Read(stream),
- @pixelWidth: FfiConverterUInt64.INSTANCE.Read(stream),
- @pixelHeight: FfiConverterUInt64.INSTANCE.Read(stream),
- @pixelCount: FfiConverterUInt64.INSTANCE.Read(stream)
- );
- }
-
- public override int AllocationSize(Constants value) {
- return
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@tileSize) +
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@tileWidth) +
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@tileHeight) +
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@pixelWidth) +
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@pixelHeight) +
- FfiConverterUInt64.INSTANCE.AllocationSize(value.@pixelCount);
- }
-
- public override void Write(Constants value, BigEndianStream stream) {
- FfiConverterUInt64.INSTANCE.Write(value.@tileSize, stream);
- FfiConverterUInt64.INSTANCE.Write(value.@tileWidth, stream);
- FfiConverterUInt64.INSTANCE.Write(value.@tileHeight, stream);
- FfiConverterUInt64.INSTANCE.Write(value.@pixelWidth, stream);
- FfiConverterUInt64.INSTANCE.Write(value.@pixelHeight, stream);
- FfiConverterUInt64.INSTANCE.Write(value.@pixelCount, stream);
- }
-}
-
-
-
-
-
-public class CharGridException: UniffiException {
- // Each variant is a nested class
-
-
- public class StringNotOneChar : CharGridException {
- // Members
- public String @value;
-
- // Constructor
- public StringNotOneChar(
- String @value) {
- this.@value = @value;
- }
- }
-
-
- public class InvalidSeriesLength : CharGridException {
- // Members
- public ulong @actual;
- public ulong @expected;
-
- // Constructor
- public InvalidSeriesLength(
- ulong @actual,
- ulong @expected) {
- this.@actual = @actual;
- this.@expected = @expected;
- }
- }
-
-
- public class OutOfBounds : CharGridException {
- // Members
- public ulong @index;
- public ulong @size;
-
- // Constructor
- public OutOfBounds(
- ulong @index,
- ulong @size) {
- this.@index = @index;
- this.@size = @size;
- }
- }
-
-
-
-}
-
-class FfiConverterTypeCharGridException : FfiConverterRustBuffer, CallStatusErrorHandler {
- public static FfiConverterTypeCharGridException INSTANCE = new FfiConverterTypeCharGridException();
-
- public override CharGridException Read(BigEndianStream stream) {
- var value = stream.ReadInt();
- switch (value) {
- case 1:
- return new CharGridException.StringNotOneChar(
- FfiConverterString.INSTANCE.Read(stream));
- case 2:
- return new CharGridException.InvalidSeriesLength(
- FfiConverterUInt64.INSTANCE.Read(stream),
- FfiConverterUInt64.INSTANCE.Read(stream));
- case 3:
- return new CharGridException.OutOfBounds(
- FfiConverterUInt64.INSTANCE.Read(stream),
- FfiConverterUInt64.INSTANCE.Read(stream));
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeCharGridException.Read()", value));
- }
- }
-
- public override int AllocationSize(CharGridException value) {
- switch (value) {
- case CharGridException.StringNotOneChar variant_value:
- return 4
- + FfiConverterString.INSTANCE.AllocationSize(variant_value.@value);
- case CharGridException.InvalidSeriesLength variant_value:
- return 4
- + FfiConverterUInt64.INSTANCE.AllocationSize(variant_value.@actual)
- + FfiConverterUInt64.INSTANCE.AllocationSize(variant_value.@expected);
- case CharGridException.OutOfBounds variant_value:
- return 4
- + FfiConverterUInt64.INSTANCE.AllocationSize(variant_value.@index)
- + FfiConverterUInt64.INSTANCE.AllocationSize(variant_value.@size);
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeCharGridException.AllocationSize()", value));
- }
- }
-
- public override void Write(CharGridException value, BigEndianStream stream) {
- switch (value) {
- case CharGridException.StringNotOneChar variant_value:
- stream.WriteInt(1);
- FfiConverterString.INSTANCE.Write(variant_value.@value, stream);
- break;
- case CharGridException.InvalidSeriesLength variant_value:
- stream.WriteInt(2);
- FfiConverterUInt64.INSTANCE.Write(variant_value.@actual, stream);
- FfiConverterUInt64.INSTANCE.Write(variant_value.@expected, stream);
- break;
- case CharGridException.OutOfBounds variant_value:
- stream.WriteInt(3);
- FfiConverterUInt64.INSTANCE.Write(variant_value.@index, stream);
- FfiConverterUInt64.INSTANCE.Write(variant_value.@size, stream);
- break;
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeCharGridException.Write()", value));
- }
- }
-}
-
-
-
-
-
-public enum CompressionCode: int {
-
- Uncompressed,
- Zlib,
- Bzip2,
- Lzma,
- Zstd
-}
-
-class FfiConverterTypeCompressionCode: FfiConverterRustBuffer {
- public static FfiConverterTypeCompressionCode INSTANCE = new FfiConverterTypeCompressionCode();
-
- public override CompressionCode Read(BigEndianStream stream) {
- var value = stream.ReadInt() - 1;
- if (Enum.IsDefined(typeof(CompressionCode), value)) {
- return (CompressionCode)value;
- } else {
- throw new InternalException(String.Format("invalid enum value '{0}' in FfiConverterTypeCompressionCode.Read()", value));
- }
- }
-
- public override int AllocationSize(CompressionCode value) {
- return 4;
- }
-
- public override void Write(CompressionCode value, BigEndianStream stream) {
- stream.WriteInt((int)value + 1);
- }
-}
-
-
-
-
-
-
-
-public class ServicePointException: UniffiException {
- // Each variant is a nested class
-
-
- public class IoException : ServicePointException {
- // Members
- public String @error;
-
- // Constructor
- public IoException(
- String @error) {
- this.@error = @error;
- }
- }
-
-
- public class InvalidBrightness : ServicePointException {
- // Members
- public byte @value;
-
- // Constructor
- public InvalidBrightness(
- byte @value) {
- this.@value = @value;
- }
- }
-
-
-
-}
-
-class FfiConverterTypeServicePointException : FfiConverterRustBuffer, CallStatusErrorHandler {
- public static FfiConverterTypeServicePointException INSTANCE = new FfiConverterTypeServicePointException();
-
- public override ServicePointException Read(BigEndianStream stream) {
- var value = stream.ReadInt();
- switch (value) {
- case 1:
- return new ServicePointException.IoException(
- FfiConverterString.INSTANCE.Read(stream));
- case 2:
- return new ServicePointException.InvalidBrightness(
- FfiConverterUInt8.INSTANCE.Read(stream));
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeServicePointException.Read()", value));
- }
- }
-
- public override int AllocationSize(ServicePointException value) {
- switch (value) {
- case ServicePointException.IoException variant_value:
- return 4
- + FfiConverterString.INSTANCE.AllocationSize(variant_value.@error);
- case ServicePointException.InvalidBrightness variant_value:
- return 4
- + FfiConverterUInt8.INSTANCE.AllocationSize(variant_value.@value);
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeServicePointException.AllocationSize()", value));
- }
- }
-
- public override void Write(ServicePointException value, BigEndianStream stream) {
- switch (value) {
- case ServicePointException.IoException variant_value:
- stream.WriteInt(1);
- FfiConverterString.INSTANCE.Write(variant_value.@error, stream);
- break;
- case ServicePointException.InvalidBrightness variant_value:
- stream.WriteInt(2);
- FfiConverterUInt8.INSTANCE.Write(variant_value.@value, stream);
- break;
- default:
- throw new InternalException(String.Format("invalid error value '{0}' in FfiConverterTypeServicePointException.Write()", value));
- }
- }
-}
-#pragma warning restore 8625
-public static class ServicepointBindingUniffiMethods {
- public static Constants GetConstants() {
- return FfiConverterTypeConstants.INSTANCE.Lift(
- _UniffiHelpers.RustCall( (ref RustCallStatus _status) =>
- _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_func_get_constants( ref _status)
-));
- }
-
-}
-
diff --git a/libraries/csharp/csharp.sln b/libraries/csharp/csharp.sln
deleted file mode 100644
index 2fbf818..0000000
--- a/libraries/csharp/csharp.sln
+++ /dev/null
@@ -1,34 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.0.31903.59
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicePoint", "ServicePoint\ServicePoint.csproj", "{53576D3C-E32E-49BF-BF10-2DB504E50CE1}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicePoint.Example", "ServicePoint.Example\ServicePoint.Example.csproj", "{FEF24227-090E-46C2-B8F6-ACB5AA1A4309}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ServicePoint.Tests", "ServicePoint.Tests\ServicePoint.Tests.csproj", "{9DC15508-A980-4135-9FC6-659FF54B4E5C}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {53576D3C-E32E-49BF-BF10-2DB504E50CE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {53576D3C-E32E-49BF-BF10-2DB504E50CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {53576D3C-E32E-49BF-BF10-2DB504E50CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {53576D3C-E32E-49BF-BF10-2DB504E50CE1}.Release|Any CPU.Build.0 = Release|Any CPU
- {FEF24227-090E-46C2-B8F6-ACB5AA1A4309}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FEF24227-090E-46C2-B8F6-ACB5AA1A4309}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FEF24227-090E-46C2-B8F6-ACB5AA1A4309}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FEF24227-090E-46C2-B8F6-ACB5AA1A4309}.Release|Any CPU.Build.0 = Release|Any CPU
- {9DC15508-A980-4135-9FC6-659FF54B4E5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {9DC15508-A980-4135-9FC6-659FF54B4E5C}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {9DC15508-A980-4135-9FC6-659FF54B4E5C}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {9DC15508-A980-4135-9FC6-659FF54B4E5C}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
-EndGlobal
diff --git a/libraries/ruby/example/Gemfile b/libraries/ruby/example/Gemfile
deleted file mode 100644
index f44ed21..0000000
--- a/libraries/ruby/example/Gemfile
+++ /dev/null
@@ -1,3 +0,0 @@
-source 'https://rubygems.org'
-
-gem 'servicepoint', path: '..'
diff --git a/libraries/ruby/example/Gemfile.lock b/libraries/ruby/example/Gemfile.lock
deleted file mode 100644
index 2b6d5f7..0000000
--- a/libraries/ruby/example/Gemfile.lock
+++ /dev/null
@@ -1,19 +0,0 @@
-PATH
- remote: ..
- specs:
- servicepoint (0.0.0)
- ffi
-
-GEM
- remote: https://rubygems.org/
- specs:
- ffi (1.17.0-x86_64-linux-gnu)
-
-PLATFORMS
- x86_64-linux
-
-DEPENDENCIES
- servicepoint!
-
-BUNDLED WITH
- 2.3.27
diff --git a/libraries/ruby/example/example.rb b/libraries/ruby/example/example.rb
deleted file mode 100644
index 8d212f2..0000000
--- a/libraries/ruby/example/example.rb
+++ /dev/null
@@ -1,25 +0,0 @@
-require_relative "../lib/servicepoint_binding_uniffi"
-
-include ServicepointBindingUniffi
-
-connection = Connection.new("172.23.42.29:2342")
-
-pixels = Bitmap.new_max_sized
-x_offset = 0
-loop do
-
- pixels.fill(false)
-
- (0..((pixels.height) -1)).each do |y|
- pixels.set((y + x_offset) % pixels.width, y, true);
- end
-
- command = Command.bitmap_linear_win(0, 0, pixels, CompressionCode::UNCOMPRESSED)
-
- connection.send(command)
- sleep 0.0005
-
- x_offset += 1
-end
-
-
diff --git a/libraries/ruby/example/example.sh b/libraries/ruby/example/example.sh
deleted file mode 100755
index 25ed29e..0000000
--- a/libraries/ruby/example/example.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/usr/bin/env bash
-
-LD_LIBRARY_PATH="../../../../../target/release:$LD_LIBRARY_PATH" ruby example.rb
diff --git a/libraries/ruby/lib/servicepoint_binding_uniffi.rb b/libraries/ruby/lib/servicepoint_binding_uniffi.rb
deleted file mode 100644
index d097798..0000000
--- a/libraries/ruby/lib/servicepoint_binding_uniffi.rb
+++ /dev/null
@@ -1,2003 +0,0 @@
-# This file was autogenerated by some hot garbage in the `uniffi` crate.
-# Trust me, you don't want to mess with it!
-
-# Common helper code.
-#
-# Ideally this would live in a separate .rb file where it can be unittested etc
-# in isolation, and perhaps even published as a re-useable package.
-#
-# However, it's important that the details of how this helper code works (e.g. the
-# way that different builtin types are passed across the FFI) exactly match what's
-# expected by the rust code on the other side of the interface. In practice right
-# now that means coming from the exact some version of `uniffi` that was used to
-# compile the rust component. The easiest way to ensure this is to bundle the Ruby
-# helpers directly inline like we're doing here.
-
-require 'ffi'
-
-
-module ServicepointBindingUniffi
- def self.uniffi_in_range(i, type_name, min, max)
- raise TypeError, "no implicit conversion of #{i} into Integer" unless i.respond_to?(:to_int)
- i = i.to_int
- raise RangeError, "#{type_name} requires #{min} <= value < #{max}" unless (min <= i && i < max)
- i
-end
-
-def self.uniffi_utf8(v)
- raise TypeError, "no implicit conversion of #{v} into String" unless v.respond_to?(:to_str)
- v = v.to_str.encode(Encoding::UTF_8)
- raise Encoding::InvalidByteSequenceError, "not a valid UTF-8 encoded string" unless v.valid_encoding?
- v
-end
-
-def self.uniffi_bytes(v)
- raise TypeError, "no implicit conversion of #{v} into String" unless v.respond_to?(:to_str)
- v.to_str
-end
-
- class RustBuffer < FFI::Struct
- layout :capacity, :int32,
- :len, :int32,
- :data, :pointer
-
- def self.alloc(size)
- return ServicepointBindingUniffi.rust_call(:ffi_servicepoint_binding_uniffi_rustbuffer_alloc, size)
- end
-
- def self.reserve(rbuf, additional)
- return ServicepointBindingUniffi.rust_call(:ffi_servicepoint_binding_uniffi_rustbuffer_reserve, rbuf, additional)
- end
-
- def free
- ServicepointBindingUniffi.rust_call(:ffi_servicepoint_binding_uniffi_rustbuffer_free, self)
- end
-
- def capacity
- self[:capacity]
- end
-
- def len
- self[:len]
- end
-
- def len=(value)
- self[:len] = value
- end
-
- def data
- self[:data]
- end
-
- def to_s
- "RustBuffer(capacity=#{capacity}, len=#{len}, data=#{data.read_bytes len})"
- end
-
- # The allocated buffer will be automatically freed if an error occurs, ensuring that
- # we don't accidentally leak it.
- def self.allocWithBuilder
- builder = RustBufferBuilder.new
-
- begin
- yield builder
- rescue => e
- builder.discard
- raise e
- end
- end
-
- # The RustBuffer will be freed once the context-manager exits, ensuring that we don't
- # leak it even if an error occurs.
- def consumeWithStream
- stream = RustBufferStream.new self
-
- yield stream
-
- raise RuntimeError, 'junk data left in buffer after consuming' if stream.remaining != 0
- ensure
- free
- end# The primitive String type.
-
- def self.allocFromString(value)
- RustBuffer.allocWithBuilder do |builder|
- builder.write value.encode('utf-8')
- return builder.finalize
- end
- end
-
- def consumeIntoString
- consumeWithStream do |stream|
- return stream.read(stream.remaining).force_encoding(Encoding::UTF_8)
- end
- end
-
- # The primitive Bytes type.
-
- def self.allocFromBytes(value)
- RustBuffer.allocWithBuilder do |builder|
- builder.write_Bytes(value)
- return builder.finalize
- end
- end
-
- def consumeIntoBytes
- consumeWithStream do |stream|
- return stream.readBytes
- end
- end
-
- # The Record type Constants.
-
- def self.alloc_from_TypeConstants(v)
- RustBuffer.allocWithBuilder do |builder|
- builder.write_TypeConstants(v)
- return builder.finalize
- end
- end
-
- def consumeIntoTypeConstants
- consumeWithStream do |stream|
- return stream.readTypeConstants
- end
- end
-
-
-
- # The Enum type CompressionCode.
-
- def self.alloc_from_TypeCompressionCode(v)
- RustBuffer.allocWithBuilder do |builder|
- builder.write_TypeCompressionCode(v)
- return builder.finalize
- end
- end
-
- def consumeIntoTypeCompressionCode
- consumeWithStream do |stream|
- return stream.readTypeCompressionCode
- end
- end
-
-
-
-
-
-end
-
-module UniFFILib
- class ForeignBytes < FFI::Struct
- layout :len, :int32,
- :data, :pointer
-
- def len
- self[:len]
- end
-
- def data
- self[:data]
- end
-
- def to_s
- "ForeignBytes(len=#{len}, data=#{data.read_bytes(len)})"
- end
- end
-end
-
-private_constant :UniFFILib
-
-# Helper for structured reading of values from a RustBuffer.
-class RustBufferStream
-
- def initialize(rbuf)
- @rbuf = rbuf
- @offset = 0
- end
-
- def remaining
- @rbuf.len - @offset
- end
-
- def read(size)
- raise InternalError, 'read past end of rust buffer' if @offset + size > @rbuf.len
-
- data = @rbuf.data.get_bytes @offset, size
-
- @offset += size
-
- data
- end
-
- def readU8
- unpack_from 1, 'c'
- end
-
- def readU64
- unpack_from 8, 'Q>'
- end
-
- def readBool
- v = unpack_from 1, 'c'
-
- return false if v == 0
- return true if v == 1
-
- raise InternalError, 'Unexpected byte for Boolean type'
- end
-
- def readString
- size = unpack_from 4, 'l>'
-
- raise InternalError, 'Unexpected negative string length' if size.negative?
-
- read(size).force_encoding(Encoding::UTF_8)
- end
-
- def readBytes
- size = unpack_from 4, 'l>'
-
- raise InternalError, 'Unexpected negative byte string length' if size.negative?
-
- read(size).force_encoding(Encoding::BINARY)
- end
-
- # The Object type BitVec.
-
- def readTypeBitVec
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return BitVec._uniffi_allocate(pointer)
- end
-
- # The Object type Bitmap.
-
- def readTypeBitmap
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return Bitmap._uniffi_allocate(pointer)
- end
-
- # The Object type BrightnessGrid.
-
- def readTypeBrightnessGrid
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return BrightnessGrid._uniffi_allocate(pointer)
- end
-
- # The Object type CharGrid.
-
- def readTypeCharGrid
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return CharGrid._uniffi_allocate(pointer)
- end
-
- # The Object type Command.
-
- def readTypeCommand
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return Command._uniffi_allocate(pointer)
- end
-
- # The Object type Connection.
-
- def readTypeConnection
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return Connection._uniffi_allocate(pointer)
- end
-
- # The Object type Cp437Grid.
-
- def readTypeCp437Grid
- pointer = FFI::Pointer.new unpack_from 8, 'Q>'
- return Cp437Grid._uniffi_allocate(pointer)
- end
-
- # The Record type Constants.
-
- def readTypeConstants
- Constants.new(
- readU64,
- readU64,
- readU64,
- readU64,
- readU64,
- readU64
- )
- end
-
-
-
-
-
- # The Error type CharGridError
-
- def readTypeCharGridError
- variant = unpack_from 4, 'l>'
-
- if variant == 1
- return CharGridError::StringNotOneChar.new(
- readString()
- )
- end
- if variant == 2
- return CharGridError::InvalidSeriesLength.new(
- readU64(),
- readU64()
- )
- end
- if variant == 3
- return CharGridError::OutOfBounds.new(
- readU64(),
- readU64()
- )
- end
-
- raise InternalError, 'Unexpected variant tag for TypeCharGridError'
- end
-
-
-
-
- # The Enum type CompressionCode.
-
- def readTypeCompressionCode
- variant = unpack_from 4, 'l>'
-
- if variant == 1
- return CompressionCode::UNCOMPRESSED
- end
- if variant == 2
- return CompressionCode::ZLIB
- end
- if variant == 3
- return CompressionCode::BZIP2
- end
- if variant == 4
- return CompressionCode::LZMA
- end
- if variant == 5
- return CompressionCode::ZSTD
- end
-
- raise InternalError, 'Unexpected variant tag for TypeCompressionCode'
- end
-
-
-
-
-
-
-
- # The Error type ServicePointError
-
- def readTypeServicePointError
- variant = unpack_from 4, 'l>'
-
- if variant == 1
- return ServicePointError::IoError.new(
- readString()
- )
- end
- if variant == 2
- return ServicePointError::InvalidBrightness.new(
- readU8()
- )
- end
-
- raise InternalError, 'Unexpected variant tag for TypeServicePointError'
- end
-
-
-
-
- def unpack_from(size, format)
- raise InternalError, 'read past end of rust buffer' if @offset + size > @rbuf.len
-
- value = @rbuf.data.get_bytes(@offset, size).unpack format
-
- @offset += size
-
- # TODO: verify this
- raise 'more than one element!!!' if value.size > 1
-
- value[0]
- end
-end
-
-private_constant :RustBufferStream
-
-# Helper for structured writing of values into a RustBuffer.
-class RustBufferBuilder
- def initialize
- @rust_buf = RustBuffer.alloc 16
- @rust_buf.len = 0
- end
-
- def finalize
- rbuf = @rust_buf
-
- @rust_buf = nil
-
- rbuf
- end
-
- def discard
- return if @rust_buf.nil?
-
- rbuf = finalize
- rbuf.free
- end
-
- def write(value)
- reserve(value.bytes.size) do
- @rust_buf.data.put_array_of_char @rust_buf.len, value.bytes
- end
- end
-
- def write_U8(v)
- v = ServicepointBindingUniffi::uniffi_in_range(v, "u8", 0, 2**8)
- pack_into(1, 'c', v)
- end
-
- def write_U64(v)
- v = ServicepointBindingUniffi::uniffi_in_range(v, "u64", 0, 2**64)
- pack_into(8, 'Q>', v)
- end
-
- def write_Bool(v)
- pack_into(1, 'c', v ? 1 : 0)
- end
-
- def write_String(v)
- v = ServicepointBindingUniffi::uniffi_utf8(v)
- pack_into 4, 'l>', v.bytes.size
- write v
- end
-
- def write_Bytes(v)
- v = ServicepointBindingUniffi::uniffi_bytes(v)
- pack_into 4, 'l>', v.bytes.size
- write v
- end
-
- # The Object type BitVec.
-
- def write_TypeBitVec(obj)
- pointer = BitVec._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type Bitmap.
-
- def write_TypeBitmap(obj)
- pointer = Bitmap._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type BrightnessGrid.
-
- def write_TypeBrightnessGrid(obj)
- pointer = BrightnessGrid._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type CharGrid.
-
- def write_TypeCharGrid(obj)
- pointer = CharGrid._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type Command.
-
- def write_TypeCommand(obj)
- pointer = Command._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type Connection.
-
- def write_TypeConnection(obj)
- pointer = Connection._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Object type Cp437Grid.
-
- def write_TypeCp437Grid(obj)
- pointer = Cp437Grid._uniffi_lower obj
- pack_into(8, 'Q>', pointer.address)
- end
-
- # The Record type Constants.
-
- def write_TypeConstants(v)
- self.write_U64(v.tile_size)
- self.write_U64(v.tile_width)
- self.write_U64(v.tile_height)
- self.write_U64(v.pixel_width)
- self.write_U64(v.pixel_height)
- self.write_U64(v.pixel_count)
- end
-
-
-
- # The Enum type CompressionCode.
-
- def write_TypeCompressionCode(v)
- pack_into(4, 'l>', v)
- end
-
-
-
-
-
-
- private
-
- def reserve(num_bytes)
- if @rust_buf.len + num_bytes > @rust_buf.capacity
- @rust_buf = RustBuffer.reserve(@rust_buf, num_bytes)
- end
-
- yield
-
- @rust_buf.len += num_bytes
- end
-
- def pack_into(size, format, value)
- reserve(size) do
- @rust_buf.data.put_array_of_char @rust_buf.len, [value].pack(format).bytes
- end
- end
-end
-
-private_constant :RustBufferBuilder
-
- # Error definitions
- class RustCallStatus < FFI::Struct
- layout :code, :int8,
- :error_buf, RustBuffer
-
- def code
- self[:code]
- end
-
- def error_buf
- self[:error_buf]
- end
-
- def to_s
- "RustCallStatus(code=#{self[:code]})"
- end
-end
-
-# These match the values from the uniffi::rustcalls module
-CALL_SUCCESS = 0
-CALL_ERROR = 1
-CALL_PANIC = 2
-
-
-module CharGridError
- class StringNotOneChar < StandardError
- def initialize(value)
- @value = value
- super()
- end
-
- attr_reader :value
-
-
- def to_s
- "#{self.class.name}(value=#{@value.inspect})"
- end
- end
- class InvalidSeriesLength < StandardError
- def initialize(actual, expected)
- @actual = actual
- @expected = expected
- super()
- end
-
- attr_reader :actual, :expected
-
-
- def to_s
- "#{self.class.name}(actual=#{@actual.inspect}, expected=#{@expected.inspect})"
- end
- end
- class OutOfBounds < StandardError
- def initialize(index, size)
- @index = index
- @size = size
- super()
- end
-
- attr_reader :index, :size
-
-
- def to_s
- "#{self.class.name}(index=#{@index.inspect}, size=#{@size.inspect})"
- end
- end
-
-end
-
-
-
-
-module ServicePointError
- class IoError < StandardError
- def initialize(error)
- @error = error
- super()
- end
-
- attr_reader :error
-
-
- def to_s
- "#{self.class.name}(error=#{@error.inspect})"
- end
- end
- class InvalidBrightness < StandardError
- def initialize(value)
- @value = value
- super()
- end
-
- attr_reader :value
-
-
- def to_s
- "#{self.class.name}(value=#{@value.inspect})"
- end
- end
-
-end
-
-
-# Map error modules to the RustBuffer method name that reads them
-ERROR_MODULE_TO_READER_METHOD = {
-
- CharGridError => :readTypeCharGridError,
-
-
-
- ServicePointError => :readTypeServicePointError,
-
-}
-
-private_constant :ERROR_MODULE_TO_READER_METHOD, :CALL_SUCCESS, :CALL_ERROR, :CALL_PANIC,
- :RustCallStatus
-
-def self.consume_buffer_into_error(error_module, rust_buffer)
- rust_buffer.consumeWithStream do |stream|
- reader_method = ERROR_MODULE_TO_READER_METHOD[error_module]
- return stream.send(reader_method)
- end
-end
-
-class InternalError < StandardError
-end
-
-def self.rust_call(fn_name, *args)
- # Call a rust function
- rust_call_with_error(nil, fn_name, *args)
-end
-
-def self.rust_call_with_error(error_module, fn_name, *args)
- # Call a rust function and handle errors
- #
- # Use this when the rust function returns a Result<>. error_module must be the error_module that corresponds to that Result.
-
-
- # Note: RustCallStatus.new zeroes out the struct, which is exactly what we
- # want to pass to Rust (code=0, error_buf=RustBuffer(len=0, capacity=0,
- # data=NULL))
- status = RustCallStatus.new
- args << status
-
- result = UniFFILib.public_send(fn_name, *args)
-
- case status.code
- when CALL_SUCCESS
- result
- when CALL_ERROR
- if error_module.nil?
- status.error_buf.free
- raise InternalError, "CALL_ERROR with no error_module set"
- else
- raise consume_buffer_into_error(error_module, status.error_buf)
- end
- when CALL_PANIC
- # When the rust code sees a panic, it tries to construct a RustBuffer
- # with the message. But if that code panics, then it just sends back
- # an empty buffer.
- if status.error_buf.len > 0
- raise InternalError, status.error_buf.consumeIntoString()
- else
- raise InternalError, "Rust panic"
- end
- else
- raise InternalError, "Unknown call status: #{status.code}"
- end
-end
-
-private_class_method :consume_buffer_into_error
-
- # This is how we find and load the dynamic library provided by the component.
-# For now we just look it up by name.
-module UniFFILib
- extend FFI::Library
-
-
- ffi_lib 'servicepoint_binding_uniffi'
-
-
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_bitvec,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load,
- [RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new,
- [:uint64, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw,
- [:pointer, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill,
- [:pointer, :int8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get,
- [:pointer, :uint64, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set,
- [:pointer, :uint64, :int8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_bitmap,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_load,
- [:uint64, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new,
- [:uint64, :uint64, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized,
- [RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw,
- [:pointer, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill,
- [:pointer, :int8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get,
- [:pointer, :uint64, :uint64, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set,
- [:pointer, :uint64, :uint64, :int8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_load,
- [:uint64, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new,
- [:uint64, :uint64, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw,
- [:pointer, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill,
- [:pointer, :uint8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get,
- [:pointer, :uint64, :uint64, RustCallStatus.by_ref],
- :uint8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set,
- [:pointer, :uint64, :uint64, :uint8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_chargrid,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load,
- [RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_new,
- [:uint64, :uint64, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string,
- [:pointer, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill,
- [:pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get,
- [:pointer, :uint64, :uint64, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col,
- [:pointer, :uint64, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row,
- [:pointer, :uint64, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set,
- [:pointer, :uint64, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col,
- [:pointer, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row,
- [:pointer, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_command,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear,
- [:uint64, :pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_and,
- [:uint64, :pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_or,
- [:uint64, :pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_win,
- [:uint64, :uint64, :pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_xor,
- [:uint64, :pointer, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_brightness,
- [:uint8, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_char_brightness,
- [:uint64, :uint64, :pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_clear,
- [RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_cp437_data,
- [:uint64, :uint64, :pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_fade_out,
- [RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_hard_reset,
- [RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_command_utf8_data,
- [:uint64, :uint64, :pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_command_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_connection,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new,
- [RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new_fake,
- [RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_connection_send,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_free_cp437grid,
- [:pointer, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_clone,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_load,
- [:uint64, :uint64, RustBuffer.by_value, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new,
- [:uint64, :uint64, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw,
- [:pointer, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals,
- [:pointer, :pointer, RustCallStatus.by_ref],
- :int8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill,
- [:pointer, :uint8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get,
- [:pointer, :uint64, :uint64, RustCallStatus.by_ref],
- :uint8
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set,
- [:pointer, :uint64, :uint64, :uint8, RustCallStatus.by_ref],
- :void
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8,
- [:pointer, RustCallStatus.by_ref],
- :pointer
- attach_function :uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width,
- [:pointer, RustCallStatus.by_ref],
- :uint64
- attach_function :uniffi_servicepoint_binding_uniffi_fn_func_get_constants,
- [RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :ffi_servicepoint_binding_uniffi_rustbuffer_alloc,
- [:int32, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :ffi_servicepoint_binding_uniffi_rustbuffer_from_bytes,
- [ForeignBytes, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :ffi_servicepoint_binding_uniffi_rustbuffer_free,
- [RustBuffer.by_value, RustCallStatus.by_ref],
- :void
- attach_function :ffi_servicepoint_binding_uniffi_rustbuffer_reserve,
- [RustBuffer.by_value, :int32, RustCallStatus.by_ref],
- RustBuffer.by_value
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_func_get_constants,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_command_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_connection_send,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_and,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_or,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_win,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_xor,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new_fake,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new,
- [RustCallStatus.by_ref],
- :uint16
- attach_function :ffi_servicepoint_binding_uniffi_uniffi_contract_version,
- [RustCallStatus.by_ref],
- :uint32
-
-end
-
- # Public interface members begin here.
-
-
-
-
-
-
-class CompressionCode
- UNCOMPRESSED = 1
- ZLIB = 2
- BZIP2 = 3
- LZMA = 4
- ZSTD = 5
-
-end
-
-
-
-
- # Record type Constants
-class Constants
- attr_reader :tile_size, :tile_width, :tile_height, :pixel_width, :pixel_height, :pixel_count
-
- def initialize(tile_size, tile_width, tile_height, pixel_width, pixel_height, pixel_count)
- @tile_size = tile_size
- @tile_width = tile_width
- @tile_height = tile_height
- @pixel_width = pixel_width
- @pixel_height = pixel_height
- @pixel_count = pixel_count
- end
-
- def ==(other)
- if @tile_size != other.tile_size
- return false
- end
- if @tile_width != other.tile_width
- return false
- end
- if @tile_height != other.tile_height
- return false
- end
- if @pixel_width != other.pixel_width
- return false
- end
- if @pixel_height != other.pixel_height
- return false
- end
- if @pixel_count != other.pixel_count
- return false
- end
-
- true
- end
-end
-
-
-
-
-
-def self.get_constants()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_func_get_constants,)
- return result.consumeIntoTypeConstants
-end
-
-
-
-
-
- class BitVec
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_bitvec,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a BitVec instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(size)
- size = ServicepointBindingUniffi::uniffi_in_range(size, "u64", 0, 2**64)
- pointer = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new,size)
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_clone,(BitVec._uniffi_lower other)))
- end
- def self.load(data)
- data = ServicepointBindingUniffi::uniffi_bytes(data)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load,RustBuffer.allocFromBytes(data)))
- end
-
-
- def copy_raw()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw,@pointer,)
- return result.consumeIntoBytes
- end
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals,@pointer,(BitVec._uniffi_lower other))
- return 1 == result
- end
- def fill(value)
- value = value ? true : false
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill,@pointer,(value ? 1 : 0))
- end
-
- def get(index)
- index = ServicepointBindingUniffi::uniffi_in_range(index, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get,@pointer,index)
- return 1 == result
- end
- def len()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len,@pointer,)
- return result.to_i
- end
- def set(index, value)
- index = ServicepointBindingUniffi::uniffi_in_range(index, "u64", 0, 2**64)
- value = value ? true : false
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set,@pointer,index,(value ? 1 : 0))
- end
-
-
-end
-
- class Bitmap
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_bitmap,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a Bitmap instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(width, height)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- pointer = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new,width,height)
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_clone,(Bitmap._uniffi_lower other)))
- end
- def self.load(width, height, data)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- data = ServicepointBindingUniffi::uniffi_bytes(data)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_load,width,height,RustBuffer.allocFromBytes(data)))
- end
- def self.new_max_sized()
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized,))
- end
-
-
- def copy_raw()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw,@pointer,)
- return result.consumeIntoBytes
- end
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals,@pointer,(Bitmap._uniffi_lower other))
- return 1 == result
- end
- def fill(value)
- value = value ? true : false
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill,@pointer,(value ? 1 : 0))
- end
-
- def get(x, y)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get,@pointer,x,y)
- return 1 == result
- end
- def height()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height,@pointer,)
- return result.to_i
- end
- def set(x, y, value)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- value = value ? true : false
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set,@pointer,x,y,(value ? 1 : 0))
- end
-
- def width()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width,@pointer,)
- return result.to_i
- end
-
-end
-
- class BrightnessGrid
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a BrightnessGrid instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(width, height)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- pointer = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new,width,height)
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_clone,(BrightnessGrid._uniffi_lower other)))
- end
- def self.load(width, height, data)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- data = ServicepointBindingUniffi::uniffi_bytes(data)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_load,width,height,RustBuffer.allocFromBytes(data)))
- end
-
-
- def copy_raw()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw,@pointer,)
- return result.consumeIntoBytes
- end
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals,@pointer,(BrightnessGrid._uniffi_lower other))
- return 1 == result
- end
- def fill(value)
- value = ServicepointBindingUniffi::uniffi_in_range(value, "u8", 0, 2**8)
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill,@pointer,value)
- end
-
- def get(x, y)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get,@pointer,x,y)
- return result.to_i
- end
- def height()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height,@pointer,)
- return result.to_i
- end
- def set(x, y, value)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- value = ServicepointBindingUniffi::uniffi_in_range(value, "u8", 0, 2**8)
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set,@pointer,x,y,value)
- end
-
- def width()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width,@pointer,)
- return result.to_i
- end
-
-end
-
- class CharGrid
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_chargrid,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a CharGrid instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(width, height)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- pointer = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_new,width,height)
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone,(CharGrid._uniffi_lower other)))
- end
- def self.load(data)
- data = ServicepointBindingUniffi::uniffi_utf8(data)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load,RustBuffer.allocFromString(data)))
- end
-
-
- def as_string()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string,@pointer,)
- return result.consumeIntoString
- end
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals,@pointer,(CharGrid._uniffi_lower other))
- return 1 == result
- end
- def fill(value)
- value = ServicepointBindingUniffi::uniffi_utf8(value)
- ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill,@pointer,RustBuffer.allocFromString(value))
- end
-
- def get(x, y)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get,@pointer,x,y)
- return result.consumeIntoString
- end
- def get_col(x)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col,@pointer,x)
- return result.consumeIntoString
- end
- def get_row(y)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row,@pointer,y)
- return result.consumeIntoString
- end
- def height()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height,@pointer,)
- return result.to_i
- end
- def set(x, y, value)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- value = ServicepointBindingUniffi::uniffi_utf8(value)
- ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set,@pointer,x,y,RustBuffer.allocFromString(value))
- end
-
- def set_col(x, col)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- col = ServicepointBindingUniffi::uniffi_utf8(col)
- ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col,@pointer,x,RustBuffer.allocFromString(col))
- end
-
- def set_row(y, row)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- row = ServicepointBindingUniffi::uniffi_utf8(row)
- ServicepointBindingUniffi.rust_call_with_error(CharGridError,:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row,@pointer,y,RustBuffer.allocFromString(row))
- end
-
- def to_cp437()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437,@pointer,)
- return Cp437Grid._uniffi_allocate(result)
- end
- def width()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width,@pointer,)
- return result.to_i
- end
-
-end
-
- class Command
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_command,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a Command instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
-
- def self.bitmap_linear(offset, bitmap, compression)
- offset = ServicepointBindingUniffi::uniffi_in_range(offset, "u64", 0, 2**64)
- bitmap = bitmap
- compression = compression
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear,offset,(BitVec._uniffi_lower bitmap),RustBuffer.alloc_from_TypeCompressionCode(compression)))
- end
- def self.bitmap_linear_and(offset, bitmap, compression)
- offset = ServicepointBindingUniffi::uniffi_in_range(offset, "u64", 0, 2**64)
- bitmap = bitmap
- compression = compression
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_and,offset,(BitVec._uniffi_lower bitmap),RustBuffer.alloc_from_TypeCompressionCode(compression)))
- end
- def self.bitmap_linear_or(offset, bitmap, compression)
- offset = ServicepointBindingUniffi::uniffi_in_range(offset, "u64", 0, 2**64)
- bitmap = bitmap
- compression = compression
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_or,offset,(BitVec._uniffi_lower bitmap),RustBuffer.alloc_from_TypeCompressionCode(compression)))
- end
- def self.bitmap_linear_win(offset_x, offset_y, bitmap, compression)
- offset_x = ServicepointBindingUniffi::uniffi_in_range(offset_x, "u64", 0, 2**64)
- offset_y = ServicepointBindingUniffi::uniffi_in_range(offset_y, "u64", 0, 2**64)
- bitmap = bitmap
- compression = compression
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_win,offset_x,offset_y,(Bitmap._uniffi_lower bitmap),RustBuffer.alloc_from_TypeCompressionCode(compression)))
- end
- def self.bitmap_linear_xor(offset, bitmap, compression)
- offset = ServicepointBindingUniffi::uniffi_in_range(offset, "u64", 0, 2**64)
- bitmap = bitmap
- compression = compression
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_xor,offset,(BitVec._uniffi_lower bitmap),RustBuffer.alloc_from_TypeCompressionCode(compression)))
- end
- def self.brightness(brightness)
- brightness = ServicepointBindingUniffi::uniffi_in_range(brightness, "u8", 0, 2**8)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call_with_error(ServicePointError,:uniffi_servicepoint_binding_uniffi_fn_constructor_command_brightness,brightness))
- end
- def self.char_brightness(offset_x, offset_y, grid)
- offset_x = ServicepointBindingUniffi::uniffi_in_range(offset_x, "u64", 0, 2**64)
- offset_y = ServicepointBindingUniffi::uniffi_in_range(offset_y, "u64", 0, 2**64)
- grid = grid
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_char_brightness,offset_x,offset_y,(BrightnessGrid._uniffi_lower grid)))
- end
- def self.clear()
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_clear,))
- end
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_clone,(Command._uniffi_lower other)))
- end
- def self.cp437_data(offset_x, offset_y, grid)
- offset_x = ServicepointBindingUniffi::uniffi_in_range(offset_x, "u64", 0, 2**64)
- offset_y = ServicepointBindingUniffi::uniffi_in_range(offset_y, "u64", 0, 2**64)
- grid = grid
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_cp437_data,offset_x,offset_y,(Cp437Grid._uniffi_lower grid)))
- end
- def self.fade_out()
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_fade_out,))
- end
- def self.hard_reset()
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_hard_reset,))
- end
- def self.utf8_data(offset_x, offset_y, grid)
- offset_x = ServicepointBindingUniffi::uniffi_in_range(offset_x, "u64", 0, 2**64)
- offset_y = ServicepointBindingUniffi::uniffi_in_range(offset_y, "u64", 0, 2**64)
- grid = grid
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_command_utf8_data,offset_x,offset_y,(CharGrid._uniffi_lower grid)))
- end
-
-
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_command_equals,@pointer,(Command._uniffi_lower other))
- return 1 == result
- end
-
-end
-
- class Connection
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_connection,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a Connection instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(host)
- host = ServicepointBindingUniffi::uniffi_utf8(host)
- pointer = ServicepointBindingUniffi.rust_call_with_error(ServicePointError,:uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new,RustBuffer.allocFromString(host))
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.new_fake()
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new_fake,))
- end
-
-
- def send(command)
- command = command
- ServicepointBindingUniffi.rust_call_with_error(ServicePointError,:uniffi_servicepoint_binding_uniffi_fn_method_connection_send,@pointer,(Command._uniffi_lower command))
- end
-
-
-end
-
- class Cp437Grid
-
- # A private helper for initializing instances of the class from a raw pointer,
- # bypassing any initialization logic and ensuring they are GC'd properly.
- def self._uniffi_allocate(pointer)
- pointer.autorelease = false
- inst = allocate
- inst.instance_variable_set :@pointer, pointer
- ObjectSpace.define_finalizer(inst, _uniffi_define_finalizer_by_pointer(pointer, inst.object_id))
- return inst
- end
-
- # A private helper for registering an object finalizer.
- # N.B. it's important that this does not capture a reference
- # to the actual instance, only its underlying pointer.
- def self._uniffi_define_finalizer_by_pointer(pointer, object_id)
- Proc.new do |_id|
- ServicepointBindingUniffi.rust_call(
- :uniffi_servicepoint_binding_uniffi_fn_free_cp437grid,
- pointer
- )
- end
- end
-
- # A private helper for lowering instances into a raw pointer.
- # This does an explicit typecheck, because accidentally lowering a different type of
- # object in a place where this type is expected, could lead to memory unsafety.
- def self._uniffi_lower(inst)
- if not inst.is_a? self
- raise TypeError.new "Expected a Cp437Grid instance, got #{inst}"
- end
- return inst.instance_variable_get :@pointer
- end
- def initialize(width, height)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- pointer = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new,width,height)
- @pointer = pointer
- ObjectSpace.define_finalizer(self, self.class._uniffi_define_finalizer_by_pointer(pointer, self.object_id))
- end
-
- def self.clone(other)
- other = other
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_clone,(Cp437Grid._uniffi_lower other)))
- end
- def self.load(width, height, data)
- width = ServicepointBindingUniffi::uniffi_in_range(width, "u64", 0, 2**64)
- height = ServicepointBindingUniffi::uniffi_in_range(height, "u64", 0, 2**64)
- data = ServicepointBindingUniffi::uniffi_bytes(data)
- # Call the (fallible) function before creating any half-baked object instances.
- # Lightly yucky way to bypass the usual "initialize" logic
- # and just create a new instance with the required pointer.
- return _uniffi_allocate(ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_load,width,height,RustBuffer.allocFromBytes(data)))
- end
-
-
- def copy_raw()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw,@pointer,)
- return result.consumeIntoBytes
- end
- def equals(other)
- other = other
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals,@pointer,(Cp437Grid._uniffi_lower other))
- return 1 == result
- end
- def fill(value)
- value = ServicepointBindingUniffi::uniffi_in_range(value, "u8", 0, 2**8)
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill,@pointer,value)
- end
-
- def get(x, y)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get,@pointer,x,y)
- return result.to_i
- end
- def height()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height,@pointer,)
- return result.to_i
- end
- def set(x, y, value)
- x = ServicepointBindingUniffi::uniffi_in_range(x, "u64", 0, 2**64)
- y = ServicepointBindingUniffi::uniffi_in_range(y, "u64", 0, 2**64)
- value = ServicepointBindingUniffi::uniffi_in_range(value, "u8", 0, 2**8)
- ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set,@pointer,x,y,value)
- end
-
- def to_utf8()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8,@pointer,)
- return CharGrid._uniffi_allocate(result)
- end
- def width()
- result = ServicepointBindingUniffi.rust_call(:uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width,@pointer,)
- return result.to_i
- end
-
-end
-
-end
-
diff --git a/libraries/ruby/servicepoint.gemspec b/libraries/ruby/servicepoint.gemspec
deleted file mode 100644
index f558ad5..0000000
--- a/libraries/ruby/servicepoint.gemspec
+++ /dev/null
@@ -1,13 +0,0 @@
-Gem::Specification.new do |s|
- s.name = "servicepoint"
- s.version = "0.13.1"
- s.summary = ""
- s.description = ""
- s.authors = ["kaesaecracker"]
- s.email = ""
- s.files = ["lib/servicepoint_binding_uniffi.rb"]
- s.homepage =
- "https://rubygems.org/gems/hola"
- s.license = "MIT"
- s.add_dependency 'ffi'
-end