v0.1.1
🔦 Highlights
Initial resource
implementation
This adds the initial implementation of the resource
type.
A resource
represents a handle to a resource owned by the Host - similar to a file descriptor in posix - resources
have associated methods that allow Guests to interact with them.
A resource
is essentially just syntactic sugar for a u64
. This identifier is guaranteed to be unique and will be used by the Host to index into a ResourceTable
to retrieve the actual data backing the resource
.
interface foo {
resource bar {
func greet(name: string) -> string
}
func get_bar() -> bar
}
This represents an important addition to the type system of tauri-bindgen
as resource
s allow us to better model many real-world situations (like Tauri's Window
objects) while minimising the amount of data being sent over the IPC bridge as well as restricting Guests access to system resources.
To try this initial implementation, enable the unstable
feature flag.
Fixes
Better code generation empty return types
Previously in some situations functions that didn't return anything (func foo(x: string)
) would generate code that returned an empty tuple. This version doesn't generate these empty tuples anymore, making generated code easier to use.
Reject deprecated or invalid unicode characters
Files containing deprecated or discouraged unicode code points will now be rejected, this makes .wit
files more portable and reliable as a IDL format.
Fixed parsing of comments containing non-latin script characters
Previously parsing a .wit
file with comments that contained non-latin unicode code points would cause a panic. This version fixes that issue which means comments can be written in all scripts supported by unicode.