diff --git a/Cargo.lock b/Cargo.lock index 29a5fef..fdb4daf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,20 +10,9 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" - -[[package]] -name = "askama" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb98f10f371286b177db5eeb9a6e5396609555686a35e1d4f7b9a9c6d8af0139" -dependencies = [ - "askama_derive 0.11.2", - "askama_escape", - "askama_shared", -] +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "askama" @@ -36,14 +25,16 @@ dependencies = [ ] [[package]] -name = "askama_derive" -version = "0.11.2" +name = "askama" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87bf87e6e8b47264efa9bde63d6225c6276a52e05e91bf37eaa8afd0032d6b71" +checksum = "5d4744ed2eef2645831b441d8f5459689ade2ab27c854488fbab1fbe94fce1a7" dependencies = [ - "askama_shared", - "proc-macro2", - "syn 1.0.109", + "askama_derive 0.13.1", + "itoa", + "percent-encoding", + "serde", + "serde_json", ] [[package]] @@ -52,14 +43,31 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" dependencies = [ - "askama_parser", + "askama_parser 0.2.1", "basic-toml", "mime", "mime_guess", "proc-macro2", "quote", "serde", - "syn 2.0.96", + "syn 2.0.101", +] + +[[package]] +name = "askama_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d661e0f57be36a5c14c48f78d09011e67e0cb618f269cca9f2fd8d15b68c46ac" +dependencies = [ + "askama_parser 0.13.0", + "basic-toml", + "memchr", + "proc-macro2", + "quote", + "rustc-hash", + "serde", + "serde_derive", + "syn 2.0.101", ] [[package]] @@ -78,20 +86,15 @@ dependencies = [ ] [[package]] -name = "askama_shared" -version = "0.12.2" +name = "askama_parser" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf722b94118a07fcbc6640190f247334027685d4e218b794dbfe17c32bf38ed0" +checksum = "cf315ce6524c857bb129ff794935cf6d42c82a6cff60526fe2a63593de4d0d4f" dependencies = [ - "askama_escape", - "mime", - "mime_guess", - "nom", - "proc-macro2", - "quote", + "memchr", "serde", - "syn 1.0.109", - "toml", + "serde_derive", + "winnow", ] [[package]] @@ -113,9 +116,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "basic-toml" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" +checksum = "ba62675e8242a4c4e806d12f11d136e626e6c8361d6b829310732241652a178a" dependencies = [ "serde", ] @@ -135,6 +138,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" + [[package]] name = "bitvec" version = "1.0.1" @@ -149,27 +158,26 @@ dependencies = [ [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bzip2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b89e7c29231c673a61a46e722602bcd138298f6b9e81e71119693534585f5c" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", ] [[package]] name = "bzip2-sys" -version = "0.1.12+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -207,9 +215,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.14" +version = "1.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3d1b2e905a3a7b00a6141adb0e4c0bb941d11caf55349d863942a1cc44e3c9" +checksum = "8691782945451c1c383942c4874dbe63814f61cb57ef773cda2972682b7bb3c0" dependencies = [ "jobserver", "libc", @@ -229,7 +237,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ea181bf566f71cb9a5d17a59e1871af638180a18fb0035c92ae62b705207123" dependencies = [ "atty", - "bitflags", + "bitflags 1.3.2", "clap_derive", "clap_lex", "indexmap", @@ -245,7 +253,7 @@ version = "3.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6371b8bdc8b7d3959e9cf7b22d4435ef3e79e138688421ec654acf8c81b008" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro-error", "proc-macro2", "quote", @@ -278,14 +286,14 @@ checksum = "311a6d2f1f9d60bff73d2c78a0af97ed27f79672f15c238192a5bbb64db56d00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "miniz_oxide", @@ -306,6 +314,18 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" +[[package]] +name = "getrandom" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasi", +] + [[package]] name = "glob" version = "0.3.2" @@ -314,9 +334,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "goblin" -version = "0.6.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d6b4de4a8eb6c46a8c77e1d3be942cb9a8bf073c22374578e5ba4b08ed0ff68" +checksum = "1b363a30c165f666402fe6a3024d3bec7ebc898f96a4a23bd1c99f8dbf3f4f47" dependencies = [ "log", "plain", @@ -335,6 +355,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -356,30 +382,31 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom", "libc", ] [[package]] name = "libc" -version = "0.2.169" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" @@ -411,9 +438,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -430,15 +457,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" - -[[package]] -name = "oneshot-uniffi" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c548d5c78976f6955d72d0ced18c48ca07030f7a1d4024529fedd7c1c01b29c" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "os_str_bytes" @@ -453,10 +474,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "pkg-config" -version = "0.3.31" +name = "percent-encoding" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" + +[[package]] +name = "pkg-config" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plain" @@ -490,22 +517,28 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radium" version = "0.7.0" @@ -523,65 +556,71 @@ dependencies = [ ] [[package]] -name = "ryu" -version = "1.0.18" +name = "rustc-hash" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "scroll" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04c565b551bafbef4157586fa379538366e4385d42082f255bfd96e4fe8519da" +checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" dependencies = [ "scroll_derive", ] [[package]] name = "scroll_derive" -version = "0.11.1" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1db149f81d46d2deba7cd3c50772474707729550221e69588478ebf9ada425ae" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] name = "semver" -version = "1.0.24" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -591,9 +630,9 @@ dependencies = [ [[package]] name = "servicepoint" -version = "0.13.1" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b52049be55a15fe37c13249d7f96aa8a5de56e1a41838e74a822ee8316a0c4" +checksum = "f6bd5cfa49c73aeecb344680ffbf697abf73e0563a441b93b9723ae43867500f" dependencies = [ "bitvec", "bzip2", @@ -601,7 +640,7 @@ dependencies = [ "log", "once_cell", "rust-lzma", - "thiserror 2.0.11", + "thiserror 2.0.12", "zstd", ] @@ -610,7 +649,7 @@ name = "servicepoint_binding_uniffi" version = "0.13.1" dependencies = [ "servicepoint", - "thiserror 2.0.11", + "thiserror 2.0.12", "uniffi", ] @@ -657,9 +696,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.96" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -683,9 +722,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "smawk", "unicode-linebreak", @@ -703,11 +742,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -718,18 +757,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] @@ -749,9 +788,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -761,17 +800,19 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-width" -version = "0.1.14" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" [[package]] name = "uniffi" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21345172d31092fd48c47fd56c53d4ae9e41c4b1f559fb8c38c1ab1685fd919f" +checksum = "4cb08c58c7ed7033150132febe696bef553f891b1ede57424b40d87a89e3c170" dependencies = [ "anyhow", + "cargo_metadata", + "uniffi_bindgen", "uniffi_build", "uniffi_core", "uniffi_macros", @@ -779,35 +820,39 @@ dependencies = [ [[package]] name = "uniffi-bindgen-cs" -version = "0.8.3+v0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" +version = "0.0.0" +dependencies = [ + "uniffi-bindgen-cs 0.9.0+v0.28.3", +] + +[[package]] +name = "uniffi-bindgen-cs" +version = "0.9.0+v0.28.3" +source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=3345db909a57a1175846bc91b53721bb61ee2787#3345db909a57a1175846bc91b53721bb61ee2787" dependencies = [ "anyhow", - "askama 0.11.1", + "askama 0.13.1", "camino", + "cargo_metadata", "clap", "extend", "fs-err", - "heck", + "heck 0.4.1", "paste", "serde", "serde_json", "textwrap", "toml", - "uniffi_bindgen 0.25.0", -] - -[[package]] -name = "uniffi-bindgen-cs" -version = "0.13.1" -dependencies = [ - "uniffi-bindgen-cs 0.8.3+v0.25.0", + "uniffi_bindgen", + "uniffi_meta", + "uniffi_udl", ] [[package]] name = "uniffi_bindgen" -version = "0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cade167af943e189a55020eda2c314681e223f1e42aca7c4e52614c2b627698f" dependencies = [ "anyhow", "askama 0.12.1", @@ -816,91 +861,56 @@ dependencies = [ "fs-err", "glob", "goblin", - "heck", + "heck 0.5.0", "once_cell", "paste", "serde", "textwrap", "toml", - "uniffi_meta 0.25.0", - "uniffi_testing 0.25.0", - "uniffi_udl 0.25.0", -] - -[[package]] -name = "uniffi_bindgen" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd992f2929a053829d5875af1eff2ee3d7a7001cb3b9a46cc7895f2caede6940" -dependencies = [ - "anyhow", - "askama 0.12.1", - "camino", - "cargo_metadata", - "fs-err", - "glob", - "goblin", - "heck", - "once_cell", - "paste", - "serde", - "toml", - "uniffi_meta 0.25.3", - "uniffi_testing 0.25.3", - "uniffi_udl 0.25.3", + "uniffi_meta", + "uniffi_udl", ] [[package]] name = "uniffi_build" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "001964dd3682d600084b3aaf75acf9c3426699bc27b65e96bb32d175a31c74e9" +checksum = "4c7cf32576e08104b7dc2a6a5d815f37616e66c6866c2a639fe16e6d2286b75b" dependencies = [ "anyhow", "camino", - "uniffi_bindgen 0.25.3", + "uniffi_bindgen", ] [[package]] name = "uniffi_checksum_derive" -version = "0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" -dependencies = [ - "quote", - "syn 2.0.96", -] - -[[package]] -name = "uniffi_checksum_derive" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55137c122f712d9330fd985d66fa61bdc381752e89c35708c13ce63049a3002c" +checksum = "802d2051a700e3ec894c79f80d2705b69d85844dafbbe5d1a92776f8f48b563a" dependencies = [ "quote", - "syn 2.0.96", + "syn 2.0.101", ] [[package]] name = "uniffi_core" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6121a127a3af1665cd90d12dd2b3683c2643c5103281d0fed5838324ca1fad5b" +checksum = "bc7687007d2546c454d8ae609b105daceb88175477dac280707ad6d95bcd6f1f" dependencies = [ "anyhow", "bytes", - "camino", "log", "once_cell", - "oneshot-uniffi", "paste", "static_assertions", ] [[package]] name = "uniffi_macros" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cf7a58f101fcedafa5b77ea037999b88748607f0ef3a33eaa0efc5392e92e4" +checksum = "12c65a5b12ec544ef136693af8759fb9d11aefce740fb76916721e876639033b" dependencies = [ "bincode", "camino", @@ -909,52 +919,28 @@ dependencies = [ "proc-macro2", "quote", "serde", - "syn 2.0.96", + "syn 2.0.101", "toml", - "uniffi_build", - "uniffi_meta 0.25.3", + "uniffi_meta", ] [[package]] name = "uniffi_meta" -version = "0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a74ed96c26882dac1ca9b93ca23c827e284bacbd7ec23c6f0b0372f747d59e4" dependencies = [ "anyhow", "bytes", "siphasher", - "uniffi_checksum_derive 0.25.0", -] - -[[package]] -name = "uniffi_meta" -version = "0.25.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71dc8573a7b1ac4b71643d6da34888273ebfc03440c525121f1b3634ad3417a2" -dependencies = [ - "anyhow", - "bytes", - "siphasher", - "uniffi_checksum_derive 0.25.3", + "uniffi_checksum_derive", ] [[package]] name = "uniffi_testing" -version = "0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" -dependencies = [ - "anyhow", - "camino", - "cargo_metadata", - "fs-err", - "once_cell", -] - -[[package]] -name = "uniffi_testing" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "118448debffcb676ddbe8c5305fb933ab7e0123753e659a71dc4a693f8d9f23c" +checksum = "6a6f984f0781f892cc864a62c3a5c60361b1ccbd68e538e6c9fbced5d82268ac" dependencies = [ "anyhow", "camino", @@ -965,25 +951,15 @@ dependencies = [ [[package]] name = "uniffi_udl" -version = "0.25.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" -dependencies = [ - "anyhow", - "uniffi_meta 0.25.0", - "uniffi_testing 0.25.0", - "weedle2 4.0.0 (git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce)", -] - -[[package]] -name = "uniffi_udl" -version = "0.25.3" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "889edb7109c6078abe0e53e9b4070cf74a6b3468d141bdf5ef1bd4d1dc24a1c3" +checksum = "037820a4cfc4422db1eaa82f291a3863c92c7d1789dc513489c36223f9b4cdfc" dependencies = [ "anyhow", - "uniffi_meta 0.25.3", - "uniffi_testing 0.25.3", - "weedle2 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "textwrap", + "uniffi_meta", + "uniffi_testing", + "weedle2", ] [[package]] @@ -999,18 +975,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] -name = "weedle2" -version = "4.0.0" +name = "wasi" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e79c5206e1f43a2306fd64bdb95025ee4228960f2e6c5a8b173f3caaf807741" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ - "nom", + "wit-bindgen-rt", ] [[package]] name = "weedle2" -version = "4.0.0" -source = "git+https://github.com/NordSecurity/uniffi-bindgen-cs?rev=f68639fbc720b50ebe561ba75c66c84dc456bdce#f68639fbc720b50ebe561ba75c66c84dc456bdce" +version = "5.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "998d2c24ec099a87daf9467808859f9d82b61f1d9c9701251aea037f514eae0e" dependencies = [ "nom", ] @@ -1119,6 +1096,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.7.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9fb597c990f03753e08d3c29efbfcf2019a003b4bf4ba19225c158e1549f0f3" +dependencies = [ + "memchr", +] + +[[package]] +name = "wit-bindgen-rt" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.0", +] + [[package]] name = "wyz" version = "0.5.1" @@ -1130,27 +1125,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", diff --git a/ServicePoint/servicepoint_binding_uniffi.cs b/ServicePoint/servicepoint_binding_uniffi.cs index 2039307..6609351 100644 --- a/ServicePoint/servicepoint_binding_uniffi.cs +++ b/ServicePoint/servicepoint_binding_uniffi.cs @@ -1,5 +1,5 @@ // -// This file was generated by uniffi-bindgen-cs v0.8.3+v0.25.0 +// This file was generated by uniffi-bindgen-cs v0.9.0+v0.28.3 // See https://github.com/NordSecurity/uniffi-bindgen-cs for more information. // @@ -13,6 +13,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; +using System.Threading; namespace ServicePoint; @@ -23,13 +24,13 @@ namespace ServicePoint; [StructLayout(LayoutKind.Sequential)] internal struct RustBuffer { - public int capacity; - public int len; + public ulong capacity; + public ulong 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); + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + var buffer = _UniFFILib.ffi_servicepoint_binding_uniffi_rustbuffer_alloc(Convert.ToUInt64(size), ref status); if (buffer.data == IntPtr.Zero) { throw new AllocationException($"RustBuffer.Alloc() returned null data pointer (size={size})"); } @@ -38,26 +39,41 @@ internal struct RustBuffer { } public static void Free(RustBuffer buffer) { - _UniffiHelpers.RustCall((ref RustCallStatus status) => { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { _UniFFILib.ffi_servicepoint_binding_uniffi_rustbuffer_free(buffer, ref status); }); } - public static BigEndianStream MemoryStream(IntPtr data, int length) { - unsafe { + public static BigEndianStream MemoryStream(IntPtr data, long 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 AsStream() + { + unsafe + { + return new BigEndianStream( + new UnmanagedMemoryStream((byte*)data.ToPointer(), Convert.ToInt64(len)) + ); } } - public BigEndianStream AsWriteableStream() { - unsafe { - return new BigEndianStream(new UnmanagedMemoryStream((byte*)data.ToPointer(), capacity, capacity, FileAccess.Write)); + public BigEndianStream AsWriteableStream() + { + unsafe + { + return new BigEndianStream( + new UnmanagedMemoryStream( + (byte*)data.ToPointer(), + Convert.ToInt64(capacity), + Convert.ToInt64(capacity), + FileAccess.Write + ) + ); } } } @@ -113,7 +129,7 @@ internal abstract class FfiConverter { try { var stream = rbuf.AsWriteableStream(); Write(value, stream); - rbuf.len = Convert.ToInt32(stream.Position); + rbuf.len = Convert.ToUInt64(stream.Position); return rbuf; } catch { RustBuffer.Free(rbuf); @@ -154,7 +170,7 @@ internal abstract class FfiConverterRustBuffer: FfiConverter where E: Exception { +interface CallStatusErrorHandler where E: System.Exception { E Lift(RustBuffer error_buf); } @@ -227,14 +243,14 @@ class NullCallStatusErrorHandler: CallStatusErrorHandler { // 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); + public delegate void RustCallAction(ref UniffiRustCallStatus status); + public delegate U RustCallFunc(ref UniffiRustCallStatus 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 status = new UniffiRustCallStatus(); var return_value = callback(ref status); if (status.IsSuccess()) { return return_value; @@ -258,7 +274,7 @@ class _UniffiHelpers { public static void RustCallWithError(CallStatusErrorHandler errorHandler, RustCallAction callback) where E: UniffiException { - _UniffiHelpers.RustCallWithError(errorHandler, (ref RustCallStatus status) => { + _UniffiHelpers.RustCallWithError(errorHandler, (ref UniffiRustCallStatus status) => { callback(ref status); return 0; }); @@ -271,18 +287,55 @@ class _UniffiHelpers { // Call a rust function that returns a plain value public static void RustCall(RustCallAction callback) { - _UniffiHelpers.RustCall((ref RustCallStatus status) => { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { callback(ref status); return 0; }); } } +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); + } + } + } + } + } +} + // Big endian streams are not yet available in dotnet :'( // https://github.com/dotnet/runtime/issues/26904 -class StreamUnderflowException: Exception { +class StreamUnderflowException: System.Exception { public StreamUnderflowException() { } } @@ -420,870 +473,1214 @@ class BigEndianStream { // 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. +// This is an implementation detail that will be called internally by the public API. static class _UniFFILib { + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiRustFutureContinuationCallback( + ulong @data,sbyte @pollResult + ); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureFree( + ulong @handle + ); + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiCallbackInterfaceFree( + ulong @handle + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFuture + { + public ulong @handle; + public IntPtr @free; + } + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructU8 + { + public byte @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteU8( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructU8 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructI8 + { + public sbyte @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteI8( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructI8 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructU16 + { + public ushort @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteU16( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructU16 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructI16 + { + public short @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteI16( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructI16 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructU32 + { + public uint @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteU32( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructU32 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructI32 + { + public int @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteI32( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructI32 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructU64 + { + public ulong @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteU64( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructU64 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructI64 + { + public long @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteI64( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructI64 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructF32 + { + public float @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteF32( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructF32 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructF64 + { + public double @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteF64( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructF64 @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructPointer + { + public IntPtr @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompletePointer( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructPointer @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructRustBuffer + { + public RustBuffer @returnValue; + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteRustBuffer( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructRustBuffer @result + ); + [StructLayout(LayoutKind.Sequential)] + public struct UniffiForeignFutureStructVoid + { + public UniffiRustCallStatus @callStatus; + } + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void UniffiForeignFutureCompleteVoid( + ulong @callbackData,_UniFFILib.UniffiForeignFutureStructVoid @result + ); + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_bitvec(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_bitvec(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load(RustBuffer @data,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new(ulong @size,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill(IntPtr @ptr,sbyte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get(IntPtr @ptr,ulong @index,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set(IntPtr @ptr,ulong @index,sbyte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_bitmap(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_bitmap(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_load(ulong @width,ulong @height,RustBuffer @data,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new(ulong @width,ulong @height,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized(ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill(IntPtr @ptr,sbyte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get(IntPtr @ptr,ulong @x,ulong @y,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set(IntPtr @ptr,ulong @x,ulong @y,sbyte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_brightnessgrid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_load(ulong @width,ulong @height,RustBuffer @data,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new(ulong @width,ulong @height,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill(IntPtr @ptr,byte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern byte uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get(IntPtr @ptr,ulong @x,ulong @y,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set(IntPtr @ptr,ulong @x,ulong @y,byte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_chargrid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_chargrid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load(RustBuffer @data,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_new(ulong @width,ulong @height,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill(IntPtr @ptr,RustBuffer @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get(IntPtr @ptr,ulong @x,ulong @y,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col(IntPtr @ptr,ulong @x,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row(IntPtr @ptr,ulong @y,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set(IntPtr @ptr,ulong @x,ulong @y,RustBuffer @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col(IntPtr @ptr,ulong @x,RustBuffer @col,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row(IntPtr @ptr,ulong @y,RustBuffer @row,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_command(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_command(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear(ulong @offset,IntPtr @bitvec,RustBuffer @compression,RustBuffer @operation,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear_win(ulong @offsetX,ulong @offsetY,IntPtr @bitmap,RustBuffer @compression,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_brightness(byte @brightness,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_char_brightness(ulong @offsetX,ulong @offsetY,IntPtr @grid,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_clear(ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_cp437_data(ulong @offsetX,ulong @offsetY,IntPtr @grid,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_fade_out(ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_hard_reset(ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_command_utf8_data(ulong @offsetX,ulong @offsetY,IntPtr @grid,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_command_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_connection(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_connection(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new(RustBuffer @host,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_connection_send(IntPtr @ptr,IntPtr @command,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_clone_cp437grid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_free_cp437grid(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_clone(IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_load(ulong @width,ulong @height,RustBuffer @data,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new(ulong @width,ulong @height,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals(IntPtr @ptr,IntPtr @other,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill(IntPtr @ptr,byte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern byte uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get(IntPtr @ptr,ulong @x,ulong @y,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set(IntPtr @ptr,ulong @x,ulong @y,byte @value,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width(IntPtr @ptr,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer uniffi_servicepoint_binding_uniffi_fn_func_get_constants(ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_alloc(ulong @size,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_from_bytes(ForeignBytes @bytes,ref UniffiRustCallStatus _uniffi_out_err ); - [DllImport("servicepoint_binding_uniffi")] - public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u8(IntPtr @handle,IntPtr @uniffiCallback + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rustbuffer_free(RustBuffer @buf,ref UniffiRustCallStatus _uniffi_out_err ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer ffi_servicepoint_binding_uniffi_rustbuffer_reserve(RustBuffer @buf,ulong @additional,ref UniffiRustCallStatus _uniffi_out_err + ); + + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u8(IntPtr @handle,IntPtr @callback,IntPtr @callbackData + ); + + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u8(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern byte ffi_servicepoint_binding_uniffi_rust_future_complete_u8(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i8(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i8(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern sbyte ffi_servicepoint_binding_uniffi_rust_future_complete_i8(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u16(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u16(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern ushort ffi_servicepoint_binding_uniffi_rust_future_complete_u16(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i16(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i16(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern short ffi_servicepoint_binding_uniffi_rust_future_complete_i16(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u32(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u32(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern uint ffi_servicepoint_binding_uniffi_rust_future_complete_u32(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i32(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i32(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern int ffi_servicepoint_binding_uniffi_rust_future_complete_i32(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_u64(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_u64(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern ulong ffi_servicepoint_binding_uniffi_rust_future_complete_u64(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_i64(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_i64(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern long ffi_servicepoint_binding_uniffi_rust_future_complete_i64(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_f32(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_f32(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern float ffi_servicepoint_binding_uniffi_rust_future_complete_f32(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_f64(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_f64(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern double ffi_servicepoint_binding_uniffi_rust_future_complete_f64(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_pointer(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_pointer(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr ffi_servicepoint_binding_uniffi_rust_future_complete_pointer(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_rust_buffer(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_rust_buffer(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern RustBuffer ffi_servicepoint_binding_uniffi_rust_future_complete_rust_buffer(IntPtr @handle,ref UniffiRustCallStatus _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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_poll_void(IntPtr @handle,IntPtr @callback,IntPtr @callbackData ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern void ffi_servicepoint_binding_uniffi_rust_future_cancel_void(IntPtr @handle ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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", CallingConvention = CallingConvention.Cdecl)] + public static extern void ffi_servicepoint_binding_uniffi_rust_future_complete_void(IntPtr @handle,ref UniffiRustCallStatus _uniffi_out_err ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_func_get_constants( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_command_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_connection_send( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] 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")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern ushort uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new( ); - [DllImport("servicepoint_binding_uniffi")] + [DllImport("servicepoint_binding_uniffi", CallingConvention = CallingConvention.Cdecl)] public static extern uint ffi_servicepoint_binding_uniffi_uniffi_contract_version( ); @@ -1291,454 +1688,430 @@ static class _UniFFILib { 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}`"); + if (26 != scaffolding_contract_version) { + throw new UniffiContractVersionException($"ServicePoint: uniffi bindings expected version `26`, 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}`"); + if (checksum != 59241) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_func_get_constants` checksum `59241`, 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}`"); + if (checksum != 44858) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_copy_raw` checksum `44858`, 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}`"); + if (checksum != 56950) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_equals` checksum `56950`, 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}`"); + if (checksum != 49206) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_fill` checksum `49206`, 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}`"); + if (checksum != 4505) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_get` checksum `4505`, 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}`"); + if (checksum != 20215) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_len` checksum `20215`, 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}`"); + if (checksum != 35617) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitvec_set` checksum `35617`, 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}`"); + if (checksum != 22381) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_copy_raw` checksum `22381`, 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}`"); + if (checksum != 11420) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_equals` checksum `11420`, 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}`"); + if (checksum != 7742) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_fill` checksum `7742`, 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}`"); + if (checksum != 18964) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_get` checksum `18964`, 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}`"); + if (checksum != 45228) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_height` checksum `45228`, 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}`"); + if (checksum != 12299) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_set` checksum `12299`, 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}`"); + if (checksum != 62870) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_bitmap_width` checksum `62870`, 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}`"); + if (checksum != 5114) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_copy_raw` checksum `5114`, 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}`"); + if (checksum != 28824) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_equals` checksum `28824`, 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}`"); + if (checksum != 47185) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_fill` checksum `47185`, 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}`"); + if (checksum != 39844) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_get` checksum `39844`, 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}`"); + if (checksum != 43167) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_height` checksum `43167`, 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}`"); + if (checksum != 24064) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_set` checksum `24064`, 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}`"); + if (checksum != 22654) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_brightnessgrid_width` checksum `22654`, 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}`"); + if (checksum != 28188) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_as_string` checksum `28188`, 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}`"); + if (checksum != 60616) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_equals` checksum `60616`, 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}`"); + if (checksum != 45391) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_fill` checksum `45391`, 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}`"); + if (checksum != 1811) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get` checksum `1811`, 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}`"); + if (checksum != 37658) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_col` checksum `37658`, 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}`"); + if (checksum != 55496) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_get_row` checksum `55496`, 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}`"); + if (checksum != 37258) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_height` checksum `37258`, 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}`"); + if (checksum != 31547) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set` checksum `31547`, 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}`"); + if (checksum != 13241) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_col` checksum `13241`, 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}`"); + if (checksum != 59373) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_set_row` checksum `59373`, 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}`"); + if (checksum != 7486) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_to_cp437` checksum `7486`, 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}`"); + if (checksum != 40166) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_chargrid_width` checksum `40166`, 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}`"); + if (checksum != 10396) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_command_equals` checksum `10396`, 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}`"); + if (checksum != 32639) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_connection_send` checksum `32639`, 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}`"); + if (checksum != 3828) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_copy_raw` checksum `3828`, 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}`"); + if (checksum != 21521) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_equals` checksum `21521`, 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}`"); + if (checksum != 20435) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_fill` checksum `20435`, 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}`"); + if (checksum != 58760) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_get` checksum `58760`, 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}`"); + if (checksum != 32386) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_height` checksum `32386`, 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}`"); + if (checksum != 24881) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_set` checksum `24881`, 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}`"); + if (checksum != 36603) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_to_utf8` checksum `36603`, 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}`"); + if (checksum != 11243) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_method_cp437grid_width` checksum `11243`, 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}`"); + if (checksum != 35610) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_clone` checksum `35610`, 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}`"); + if (checksum != 4260) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_load` checksum `4260`, 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}`"); + if (checksum != 11119) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitvec_new` checksum `11119`, 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}`"); + if (checksum != 54327) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_clone` checksum `54327`, 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}`"); + if (checksum != 51708) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_load` checksum `51708`, 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}`"); + if (checksum != 40771) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new` checksum `40771`, 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}`"); + if (checksum != 47687) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_bitmap_new_max_sized` checksum `47687`, 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}`"); + if (checksum != 56444) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_clone` checksum `56444`, 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}`"); + if (checksum != 224) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_load` checksum `224`, 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}`"); + if (checksum != 45722) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_brightnessgrid_new` checksum `45722`, 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}`"); + if (checksum != 5903) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_clone` checksum `5903`, 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}`"); + if (checksum != 45804) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_load` checksum `45804`, 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}`"); + if (checksum != 2094) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_chargrid_new` checksum `2094`, 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}`"); + if (checksum != 62752) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear` checksum `62752`, 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}`"); + if (checksum != 32012) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_bitmap_linear_win` checksum `32012`, 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}`"); + if (checksum != 60895) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_brightness` checksum `60895`, 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}`"); + if (checksum != 50477) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_char_brightness` checksum `50477`, 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}`"); + if (checksum != 20330) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clear` checksum `20330`, 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}`"); + if (checksum != 42470) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_clone` checksum `42470`, 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}`"); + if (checksum != 63131) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_cp437_data` checksum `63131`, 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}`"); + if (checksum != 13752) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_fade_out` checksum `13752`, 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}`"); + if (checksum != 62911) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_hard_reset` checksum `62911`, 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}`"); + if (checksum != 60950) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_command_utf8_data` checksum `60950`, 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}`"); + if (checksum != 7315) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_connection_new` checksum `7315`, 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}`"); + if (checksum != 60629) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_clone` checksum `60629`, 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}`"); + if (checksum != 9195) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_load` checksum `9195`, 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}`"); + if (checksum != 8874) { + throw new UniffiContractChecksumException($"ServicePoint: uniffi bindings expected function `uniffi_servicepoint_binding_uniffi_checksum_constructor_cp437grid_new` checksum `8874`, library returned `{checksum}`"); } } } @@ -1837,7 +2210,7 @@ class FfiConverterString: FfiConverter { // 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); + var bytes = value.AsStream().ReadBytes(Convert.ToInt32(value.len)); return System.Text.Encoding.UTF8.GetString(bytes); } finally { RustBuffer.Free(value); @@ -1863,7 +2236,7 @@ class FfiConverterString: FfiConverter { // enough. public override int AllocationSize(string value) { const int sizeForLength = 4; - var sizeForString = value.Length * 3; + var sizeForString = System.Text.Encoding.UTF8.GetByteCount(value); return sizeForLength + sizeForString; } @@ -1897,202 +2270,190 @@ class FfiConverterByteArray: FfiConverterRustBuffer { - -// `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 BitVec : IBitVec, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class BitVecSafeHandle: FFISafeHandle { - public BitVecSafeHandle(): base() { + public BitVec(IntPtr pointer) { + this.pointer = pointer; } - public BitVecSafeHandle(IntPtr pointer): base(pointer) { + + ~BitVec() { + Destroy(); } - 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_new(FfiConverterUInt64.INSTANCE.Lower(@size), ref _status) )) {} + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_bitvec(this.pointer, ref status); + }); + } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_bitvec(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + 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) -)); + return CallWithPointer(thisPtr => FfiConverterByteArray.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_copy_raw(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_equals(thisPtr, FfiConverterTypeBitVec.INSTANCE.Lower(@other), ref _status) +))); + } + + + public void Fill(bool @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_fill(thisPtr, FfiConverterBoolean.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_get(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_len(thisPtr, ref _status) +))); + } + + + public void Set(ulong @index, bool @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitvec_set(thisPtr, FfiConverterUInt64.INSTANCE.Lower(@index), FfiConverterBoolean.INSTANCE.Lower(@value), 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitvec_load(FfiConverterByteArray.INSTANCE.Lower(@data), ref _status) )); } } - -class FfiConverterTypeBitVec: FfiConverter { +class FfiConverterTypeBitVec: FfiConverter { public static FfiConverterTypeBitVec INSTANCE = new FfiConverterTypeBitVec(); - public override BitVecSafeHandle Lower(BitVec value) { - return value.GetHandle(); + + public override IntPtr Lower(BitVec value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override BitVec Lift(BitVecSafeHandle value) { + public override BitVec Lift(IntPtr value) { return new BitVec(value); } public override BitVec Read(BigEndianStream stream) { - return Lift(new BitVecSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(BitVec value) { @@ -2100,139 +2461,212 @@ class FfiConverterTypeBitVec: FfiConverter { } public override void Write(BitVec value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).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 Bitmap : IBitmap, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class BitmapSafeHandle: FFISafeHandle { - public BitmapSafeHandle(): base() { + public Bitmap(IntPtr pointer) { + this.pointer = pointer; } - public BitmapSafeHandle(IntPtr pointer): base(pointer) { + + ~Bitmap() { + Destroy(); } - 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status) )) {} + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_bitmap(this.pointer, ref status); + }); + } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_bitmap(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + 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) -)); + return CallWithPointer(thisPtr => FfiConverterByteArray.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_copy_raw(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_equals(thisPtr, FfiConverterTypeBitmap.INSTANCE.Lower(@other), ref _status) +))); + } + + + public void Fill(bool @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_fill(thisPtr, FfiConverterBoolean.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_get(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_height(thisPtr, ref _status) +))); + } + + + public void Set(ulong @x, ulong @y, bool @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_set(thisPtr, FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterBoolean.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_bitmap_width(thisPtr, ref _status) +))); } + public static Bitmap Clone(Bitmap @other) { return new Bitmap( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_bitmap_new_max_sized( ref _status) )); } } - -class FfiConverterTypeBitmap: FfiConverter { +class FfiConverterTypeBitmap: FfiConverter { public static FfiConverterTypeBitmap INSTANCE = new FfiConverterTypeBitmap(); - public override BitmapSafeHandle Lower(Bitmap value) { - return value.GetHandle(); + + public override IntPtr Lower(Bitmap value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override Bitmap Lift(BitmapSafeHandle value) { + public override Bitmap Lift(IntPtr value) { return new Bitmap(value); } public override Bitmap Read(BigEndianStream stream) { - return Lift(new BitmapSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(Bitmap value) { @@ -2240,132 +2674,205 @@ class FfiConverterTypeBitmap: FfiConverter { } public override void Write(Bitmap value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).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 BrightnessGrid : IBrightnessGrid, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class BrightnessGridSafeHandle: FFISafeHandle { - public BrightnessGridSafeHandle(): base() { + public BrightnessGrid(IntPtr pointer) { + this.pointer = pointer; } - public BrightnessGridSafeHandle(IntPtr pointer): base(pointer) { + + ~BrightnessGrid() { + Destroy(); } - 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_brightnessgrid_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status) )) {} + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_brightnessgrid(this.pointer, ref status); + }); + } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_brightnessgrid(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + 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) -)); + return CallWithPointer(thisPtr => FfiConverterByteArray.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_copy_raw(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_equals(thisPtr, FfiConverterTypeBrightnessGrid.INSTANCE.Lower(@other), ref _status) +))); + } + + + public void Fill(byte @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_fill(thisPtr, FfiConverterUInt8.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt8.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_get(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_height(thisPtr, ref _status) +))); + } + + + public void Set(ulong @x, ulong @y, byte @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_set(thisPtr, FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterUInt8.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_brightnessgrid_width(thisPtr, ref _status) +))); } + public static BrightnessGrid Clone(BrightnessGrid @other) { return new BrightnessGrid( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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 { +class FfiConverterTypeBrightnessGrid: FfiConverter { public static FfiConverterTypeBrightnessGrid INSTANCE = new FfiConverterTypeBrightnessGrid(); - public override BrightnessGridSafeHandle Lower(BrightnessGrid value) { - return value.GetHandle(); + + public override IntPtr Lower(BrightnessGrid value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override BrightnessGrid Lift(BrightnessGridSafeHandle value) { + public override BrightnessGrid Lift(IntPtr value) { return new BrightnessGrid(value); } public override BrightnessGrid Read(BigEndianStream stream) { - return Lift(new BrightnessGridSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(BrightnessGrid value) { @@ -2373,189 +2880,264 @@ class FfiConverterTypeBrightnessGrid: FfiConverter - void Fill(String @value); - - String Get(ulong @x, ulong @y); - + void Fill(string @value); + string Get(ulong @x, ulong @y); /// - String GetCol(ulong @x); - + string GetCol(ulong @x); /// - String GetRow(ulong @y); - + string GetRow(ulong @y); ulong Height(); - /// - void Set(ulong @x, ulong @y, String @value); - + void Set(ulong @x, ulong @y, string @value); /// - void SetCol(ulong @x, String @col); - + void SetCol(ulong @x, string @col); /// - void SetRow(ulong @y, String @row); - + void SetRow(ulong @y, string @row); Cp437Grid ToCp437(); - ulong Width(); - } +public class CharGrid : ICharGrid, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class CharGridSafeHandle: FFISafeHandle { - public CharGridSafeHandle(): base() { + public CharGrid(IntPtr pointer) { + this.pointer = pointer; } - public CharGridSafeHandle(IntPtr pointer): base(pointer) { + + ~CharGrid() { + Destroy(); } - 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) -)); + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_chargrid(this.pointer, ref status); + }); } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_chargrid(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + + public string AsString() { + return CallWithPointer(thisPtr => FfiConverterString.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_as_string(thisPtr, 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) -)); + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_equals(thisPtr, 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 void Fill(string @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_fill(thisPtr, FfiConverterString.INSTANCE.Lower(@value), ref _status) )); } + + + public string Get(ulong @x, ulong @y) { + return CallWithPointer(thisPtr => FfiConverterString.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get(thisPtr, 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 GetCol(ulong @x) { + return CallWithPointer(thisPtr => FfiConverterString.INSTANCE.Lift( + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_col(thisPtr, 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 string GetRow(ulong @y) { + return CallWithPointer(thisPtr => FfiConverterString.INSTANCE.Lift( + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_get_row(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_height(thisPtr, ref _status) +))); + } + + + /// + public void Set(ulong @x, ulong @y, string @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set(thisPtr, FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterString.INSTANCE.Lower(@value), 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 SetCol(ulong @x, string @col) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_col(thisPtr, 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 void SetRow(ulong @y, string @row) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCallWithError(FfiConverterTypeCharGridError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_set_row(thisPtr, 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) -)); + return CallWithPointer(thisPtr => FfiConverterTypeCp437Grid.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_to_cp437(thisPtr, 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_chargrid_width(thisPtr, ref _status) +))); } + public static CharGrid Clone(CharGrid @other) { return new CharGrid( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_clone(FfiConverterTypeCharGrid.INSTANCE.Lower(@other), ref _status) )); } - public static CharGrid Load(String @data) { + public static CharGrid Load(string @data) { return new CharGrid( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_chargrid_load(FfiConverterString.INSTANCE.Lower(@data), ref _status) )); } } - -class FfiConverterTypeCharGrid: FfiConverter { +class FfiConverterTypeCharGrid: FfiConverter { public static FfiConverterTypeCharGrid INSTANCE = new FfiConverterTypeCharGrid(); - public override CharGridSafeHandle Lower(CharGrid value) { - return value.GetHandle(); + + public override IntPtr Lower(CharGrid value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override CharGrid Lift(CharGridSafeHandle value) { + public override CharGrid Lift(IntPtr value) { return new CharGrid(value); } public override CharGrid Read(BigEndianStream stream) { - return Lift(new CharGridSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(CharGrid value) { @@ -2563,151 +3145,201 @@ class FfiConverterTypeCharGrid: FfiConverter { } public override void Write(CharGrid value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).ToInt64()); } } public interface ICommand { - bool Equals(Command @other); - } +public class Command : ICommand, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class CommandSafeHandle: FFISafeHandle { - public CommandSafeHandle(): base() { + public Command(IntPtr pointer) { + this.pointer = pointer; } - public CommandSafeHandle(IntPtr pointer): base(pointer) { + + ~Command() { + Destroy(); } - override protected bool ReleaseHandle() { - _UniffiHelpers.RustCall((ref RustCallStatus status) => { - _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_command(this.handle, ref status); + + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_command(this.pointer, ref status); }); - return true; } -} -public class Command: FFIObject, ICommand { - public Command(CommandSafeHandle pointer): base(pointer) {} + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_command(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } 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) -)); + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_command_equals(thisPtr, FfiConverterTypeCommand.INSTANCE.Lower(@other), ref _status) +))); } + - public static Command BitmapLinear(ulong @offset, BitVec @bitmap, CompressionCode @compression) { + public static Command BitmapLinear(ulong @offset, BitVec @bitvec, CompressionCode @compression, BinaryOperation @operation) { 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) + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_command_bitmap_linear(FfiConverterUInt64.INSTANCE.Lower(@offset), FfiConverterTypeBitVec.INSTANCE.Lower(@bitvec), FfiConverterTypeCompressionCode.INSTANCE.Lower(@compression), FfiConverterTypeBinaryOperation.INSTANCE.Lower(@operation), ref _status) )); } public static Command BitmapLinearWin(ulong @offsetX, ulong @offsetY, Bitmap @bitmap, CompressionCode @compression) { return new Command( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointError.INSTANCE, (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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 { +class FfiConverterTypeCommand: FfiConverter { public static FfiConverterTypeCommand INSTANCE = new FfiConverterTypeCommand(); - public override CommandSafeHandle Lower(Command value) { - return value.GetHandle(); + + public override IntPtr Lower(Command value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override Command Lift(CommandSafeHandle value) { + public override Command Lift(IntPtr value) { return new Command(value); } public override Command Read(BigEndianStream stream) { - return Lift(new CommandSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(Command value) { @@ -2715,73 +3347,137 @@ class FfiConverterTypeCommand: FfiConverter { } public override void Write(Command value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).ToInt64()); } } public interface IConnection { - /// void Send(Command @command); - } +public class Connection : IConnection, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class ConnectionSafeHandle: FFISafeHandle { - public ConnectionSafeHandle(): base() { + public Connection(IntPtr pointer) { + this.pointer = pointer; } - public ConnectionSafeHandle(IntPtr pointer): base(pointer) { + + ~Connection() { + Destroy(); } - 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) : + public Connection(string @host) : this( - _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointException.INSTANCE, (ref RustCallStatus _status) => + _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointError.INSTANCE, (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_connection_new(FfiConverterString.INSTANCE.Lower(@host), ref _status) )) {} + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_connection(this.pointer, ref status); + }); + } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_connection(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + /// 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) + CallWithPointer(thisPtr => + _UniffiHelpers.RustCallWithError(FfiConverterTypeServicePointError.INSTANCE, (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_connection_send(thisPtr, FfiConverterTypeCommand.INSTANCE.Lower(@command), ref _status) )); } -} + -class FfiConverterTypeConnection: FfiConverter { + +} +class FfiConverterTypeConnection: FfiConverter { public static FfiConverterTypeConnection INSTANCE = new FfiConverterTypeConnection(); - public override ConnectionSafeHandle Lower(Connection value) { - return value.GetHandle(); + + public override IntPtr Lower(Connection value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override Connection Lift(ConnectionSafeHandle value) { + public override Connection Lift(IntPtr value) { return new Connection(value); } public override Connection Read(BigEndianStream stream) { - return Lift(new ConnectionSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(Connection value) { @@ -2789,141 +3485,214 @@ class FfiConverterTypeConnection: FfiConverter } public override void Write(Connection value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).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 Cp437Grid : ICp437Grid, IDisposable { + protected IntPtr pointer; + private int _wasDestroyed = 0; + private long _callCounter = 1; -public class Cp437GridSafeHandle: FFISafeHandle { - public Cp437GridSafeHandle(): base() { + public Cp437Grid(IntPtr pointer) { + this.pointer = pointer; } - public Cp437GridSafeHandle(IntPtr pointer): base(pointer) { + + ~Cp437Grid() { + Destroy(); } - 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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_constructor_cp437grid_new(FfiConverterUInt64.INSTANCE.Lower(@width), FfiConverterUInt64.INSTANCE.Lower(@height), ref _status) )) {} + protected void FreeRustArcPtr() { + _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_free_cp437grid(this.pointer, ref status); + }); + } + + protected IntPtr CloneRustArcPtr() { + return _UniffiHelpers.RustCall((ref UniffiRustCallStatus status) => { + return _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_clone_cp437grid(this.pointer, ref status); + }); + } + + public void Destroy() + { + // Only allow a single call to this method. + if (Interlocked.CompareExchange(ref _wasDestroyed, 1, 0) == 0) + { + // This decrement always matches the initial count of 1 given at creation time. + if (Interlocked.Decrement(ref _callCounter) == 0) + { + FreeRustArcPtr(); + } + } + } + + public void Dispose() + { + Destroy(); + GC.SuppressFinalize(this); // Suppress finalization to avoid unnecessary GC overhead. + } + + private void IncrementCallCounter() + { + // Check and increment the call counter, to keep the object alive. + // This needs a compare-and-set retry loop in case of concurrent updates. + long count; + do + { + count = Interlocked.Read(ref _callCounter); + if (count == 0L) throw new System.ObjectDisposedException(String.Format("'{0}' object has already been destroyed", this.GetType().Name)); + if (count == long.MaxValue) throw new System.OverflowException(String.Format("'{0}' call counter would overflow", this.GetType().Name)); + + } while (Interlocked.CompareExchange(ref _callCounter, count + 1, count) != count); + } + + private void DecrementCallCounter() + { + // This decrement always matches the increment we performed above. + if (Interlocked.Decrement(ref _callCounter) == 0) { + FreeRustArcPtr(); + } + } + + internal void CallWithPointer(Action action) + { + IncrementCallCounter(); + try { + action(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + + internal T CallWithPointer(Func func) + { + IncrementCallCounter(); + try { + return func(CloneRustArcPtr()); + } + finally { + DecrementCallCounter(); + } + } + 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) -)); + return CallWithPointer(thisPtr => FfiConverterByteArray.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_copy_raw(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterBoolean.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_equals(thisPtr, FfiConverterTypeCp437Grid.INSTANCE.Lower(@other), ref _status) +))); + } + + + public void Fill(byte @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_fill(thisPtr, FfiConverterUInt8.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt8.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_get(thisPtr, 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) + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_height(thisPtr, ref _status) +))); + } + + + public void Set(ulong @x, ulong @y, byte @value) { + CallWithPointer(thisPtr => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_set(thisPtr, FfiConverterUInt64.INSTANCE.Lower(@x), FfiConverterUInt64.INSTANCE.Lower(@y), FfiConverterUInt8.INSTANCE.Lower(@value), 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) -)); + return CallWithPointer(thisPtr => FfiConverterTypeCharGrid.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_to_utf8(thisPtr, 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) -)); + return CallWithPointer(thisPtr => FfiConverterUInt64.INSTANCE.Lift( + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => + _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_method_cp437grid_width(thisPtr, ref _status) +))); } + public static Cp437Grid Clone(Cp437Grid @other) { return new Cp437Grid( - _UniffiHelpers.RustCall( (ref RustCallStatus _status) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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) => + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _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 { +class FfiConverterTypeCp437Grid: FfiConverter { public static FfiConverterTypeCp437Grid INSTANCE = new FfiConverterTypeCp437Grid(); - public override Cp437GridSafeHandle Lower(Cp437Grid value) { - return value.GetHandle(); + + public override IntPtr Lower(Cp437Grid value) { + return value.CallWithPointer(thisPtr => thisPtr); } - public override Cp437Grid Lift(Cp437GridSafeHandle value) { + public override Cp437Grid Lift(IntPtr value) { return new Cp437Grid(value); } public override Cp437Grid Read(BigEndianStream stream) { - return Lift(new Cp437GridSafeHandle(new IntPtr(stream.ReadLong()))); + return Lift(new IntPtr(stream.ReadLong())); } public override int AllocationSize(Cp437Grid value) { @@ -2931,7 +3700,7 @@ class FfiConverterTypeCp437Grid: FfiConverter { } public override void Write(Cp437Grid value, BigEndianStream stream) { - stream.WriteLong(Lower(value).DangerousGetRawFfiValue().ToInt64()); + stream.WriteLong(Lower(value).ToInt64()); } } @@ -2962,13 +3731,13 @@ class FfiConverterTypeConstants: FfiConverterRustBuffer { } 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); + return 0 + + 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) { @@ -2985,17 +3754,57 @@ class FfiConverterTypeConstants: FfiConverterRustBuffer { +public enum BinaryOperation: int { + + Overwrite, + And, + Or, + Xor +} + +class FfiConverterTypeBinaryOperation: FfiConverterRustBuffer { + public static FfiConverterTypeBinaryOperation INSTANCE = new FfiConverterTypeBinaryOperation(); + + public override BinaryOperation Read(BigEndianStream stream) { + var value = stream.ReadInt() - 1; + if (Enum.IsDefined(typeof(BinaryOperation), value)) { + return (BinaryOperation)value; + } else { + throw new InternalException(String.Format("invalid enum value '{0}' in FfiConverterTypeBinaryOperation.Read()", value)); + } + } + + public override int AllocationSize(BinaryOperation value) { + return 4; + } + + public override void Write(BinaryOperation value, BigEndianStream stream) { + stream.WriteInt((int)value + 1); + } +} + + + + + + + public class CharGridException: UniffiException { + CharGridException() : base() {} + CharGridException(String @Message) : base(@Message) {} + // Each variant is a nested class public class StringNotOneChar : CharGridException { // Members - public String @value; + public string @value; // Constructor public StringNotOneChar( - String @value) { + string @value) : base( + "@value" + "=" + @value) { + this.@value = @value; } } @@ -3009,8 +3818,12 @@ public class CharGridException: UniffiException { // Constructor public InvalidSeriesLength( ulong @actual, - ulong @expected) { + ulong @expected) : base( + "@actual" + "=" + @actual+ ", " + + "@expected" + "=" + @expected) { + this.@actual = @actual; + this.@expected = @expected; } } @@ -3024,8 +3837,12 @@ public class CharGridException: UniffiException { // Constructor public OutOfBounds( ulong @index, - ulong @size) { + ulong @size) : base( + "@index" + "=" + @index+ ", " + + "@size" + "=" + @size) { + this.@index = @index; + this.@size = @size; } } @@ -3034,8 +3851,8 @@ public class CharGridException: UniffiException { } -class FfiConverterTypeCharGridException : FfiConverterRustBuffer, CallStatusErrorHandler { - public static FfiConverterTypeCharGridException INSTANCE = new FfiConverterTypeCharGridException(); +class FfiConverterTypeCharGridError : FfiConverterRustBuffer, CallStatusErrorHandler { + public static FfiConverterTypeCharGridError INSTANCE = new FfiConverterTypeCharGridError(); public override CharGridException Read(BigEndianStream stream) { var value = stream.ReadInt(); @@ -3052,25 +3869,28 @@ class FfiConverterTypeCharGridException : FfiConverterRustBuffer + /// no compression + /// Uncompressed, + /// + /// compress using flate2 with zlib header + /// Zlib, + /// + /// compress using bzip2 + /// Bzip2, + /// + /// compress using lzma + /// Lzma, + /// + /// compress using Zstandard + /// Zstd } @@ -3137,16 +3972,21 @@ class FfiConverterTypeCompressionCode: FfiConverterRustBuffer { public class ServicePointException: UniffiException { + ServicePointException() : base() {} + ServicePointException(String @Message) : base(@Message) {} + // Each variant is a nested class public class IoException : ServicePointException { // Members - public String @error; + public string @error; // Constructor public IoException( - String @error) { + string @error) : base( + "@error" + "=" + @error) { + this.@error = @error; } } @@ -3158,7 +3998,9 @@ public class ServicePointException: UniffiException { // Constructor public InvalidBrightness( - byte @value) { + byte @value) : base( + "@value" + "=" + @value) { + this.@value = @value; } } @@ -3167,8 +4009,8 @@ public class ServicePointException: UniffiException { } -class FfiConverterTypeServicePointException : FfiConverterRustBuffer, CallStatusErrorHandler { - public static FfiConverterTypeServicePointException INSTANCE = new FfiConverterTypeServicePointException(); +class FfiConverterTypeServicePointError : FfiConverterRustBuffer, CallStatusErrorHandler { + public static FfiConverterTypeServicePointError INSTANCE = new FfiConverterTypeServicePointError(); public override ServicePointException Read(BigEndianStream stream) { var value = stream.ReadInt(); @@ -3180,20 +4022,22 @@ class FfiConverterTypeServicePointException : FfiConverterRustBuffer + _UniffiHelpers.RustCall( (ref UniffiRustCallStatus _status) => _UniFFILib.uniffi_servicepoint_binding_uniffi_fn_func_get_constants( ref _status) )); } + } diff --git a/servicepoint-binding-uniffi b/servicepoint-binding-uniffi index 1169d9f..022106e 160000 --- a/servicepoint-binding-uniffi +++ b/servicepoint-binding-uniffi @@ -1 +1 @@ -Subproject commit 1169d9f1d294268f699e9c4e088cb1d97d6c36ce +Subproject commit 022106e2dba704a58f9e6f97b1db7c9ce38005ab diff --git a/uniffi-bindgen-cs/Cargo.toml b/uniffi-bindgen-cs/Cargo.toml index 652d316..3e3f732 100644 --- a/uniffi-bindgen-cs/Cargo.toml +++ b/uniffi-bindgen-cs/Cargo.toml @@ -6,5 +6,5 @@ license = "GPL-3.0-or-later" [dependencies.uniffi-bindgen-cs] git = "https://github.com/NordSecurity/uniffi-bindgen-cs" -# tag="v0.8.3+v0.25.0" -rev = "f68639fbc720b50ebe561ba75c66c84dc456bdce" +# tag="v0.9.1+v0.28.3" +rev = "3345db909a57a1175846bc91b53721bb61ee2787"