wasmtime 26.0.0-x64-mingw-ucrt → 28.0.0-x64-mingw-ucrt
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/wasmtime/3.1/wasmtime_rb.so +0 -0
- data/lib/wasmtime/3.2/wasmtime_rb.so +0 -0
- data/lib/wasmtime/3.3/wasmtime_rb.so +0 -0
- data/lib/wasmtime/3.4/wasmtime_rb.so +0 -0
- data/lib/wasmtime/component.rb +132 -0
- data/lib/wasmtime/version.rb +1 -1
- data/lib/wasmtime.rb +3 -0
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 574f27182207de3d2abcc968dcb71230d936bd6f3c08e64ca2ada85f696557d8
|
4
|
+
data.tar.gz: f03e1c506e23de2e5ffa5834ec90cd843771b93846a04dad93ea04b7f368d54b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcb3c50f0f9c4cef56613f3c77ecf2e72d6e7fc7dce95593d4abebc0229074f9797a922cd781e22c217b943708eb5d1fc7d05dc85c7c6fea2a00b77aaa519e7f
|
7
|
+
data.tar.gz: 8efbcfd99b40dc66a2f718faffeebfd2423a4a5f51ba843acd687ad06e740dfc83867ab8d0dc66f086c0e28ca713300292b0281adf5f5647af1b4ab4062bb505
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,132 @@
|
|
1
|
+
# To prevent double loading of this file when `ruby-api` is enabled
|
2
|
+
return if defined?(Wasmtime::Component::Result)
|
3
|
+
|
4
|
+
module Wasmtime
|
5
|
+
# @note Support for Wasm components in the Ruby bindings is experimental. APIs may change in the future.
|
6
|
+
module Component
|
7
|
+
# Represents a component model's +result<O, E>+ type.
|
8
|
+
class Result
|
9
|
+
class << self
|
10
|
+
# Construct an ok result.
|
11
|
+
# @param ok [Object] the ok value
|
12
|
+
# @return [Result]
|
13
|
+
def ok(ok)
|
14
|
+
new(true, ok)
|
15
|
+
end
|
16
|
+
|
17
|
+
# Construct an error result.
|
18
|
+
# @param error [Object] the error value
|
19
|
+
# @return [Result]
|
20
|
+
def error(error)
|
21
|
+
new(false, error)
|
22
|
+
end
|
23
|
+
|
24
|
+
private :new
|
25
|
+
end
|
26
|
+
|
27
|
+
# Returns the ok value of this Result if it is {#ok?}, otherwise raises.
|
28
|
+
# @raise [UncheckedResult] if this is an error
|
29
|
+
# @return [Object]
|
30
|
+
def ok
|
31
|
+
raise UncheckedResult, "expected ok, was error" unless ok?
|
32
|
+
|
33
|
+
@value
|
34
|
+
end
|
35
|
+
|
36
|
+
# Returns the error value of this Result if it is {#error?}, otherwise raises.
|
37
|
+
# @raise [UncheckedResult] if this is an ok
|
38
|
+
# @return [Object]
|
39
|
+
def error
|
40
|
+
raise UncheckedResult, "expected error, was ok" unless error?
|
41
|
+
|
42
|
+
@value
|
43
|
+
end
|
44
|
+
|
45
|
+
# @return [Boolean] Whether the result is ok
|
46
|
+
def ok?
|
47
|
+
@ok
|
48
|
+
end
|
49
|
+
|
50
|
+
# @return [Boolean] Whether the result is an error
|
51
|
+
def error?
|
52
|
+
!@ok
|
53
|
+
end
|
54
|
+
|
55
|
+
def ==(other)
|
56
|
+
eql?(other)
|
57
|
+
end
|
58
|
+
|
59
|
+
def eql?(other)
|
60
|
+
return false unless self.class == other.class
|
61
|
+
return false unless ok? == other.ok?
|
62
|
+
|
63
|
+
if ok?
|
64
|
+
ok == other.ok
|
65
|
+
else
|
66
|
+
error == other.error
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
def hash
|
71
|
+
[self.class, @ok, @value].hash
|
72
|
+
end
|
73
|
+
|
74
|
+
def initialize(ok, value)
|
75
|
+
@ok = ok
|
76
|
+
@value = value
|
77
|
+
end
|
78
|
+
|
79
|
+
class UncheckedResult < Wasmtime::Error; end
|
80
|
+
|
81
|
+
# Hide the constructor from YARD's doc so that `.ok` or
|
82
|
+
# `.error` is used over `.new`.
|
83
|
+
private :initialize
|
84
|
+
end
|
85
|
+
|
86
|
+
# Represents a value for component model's variant case.
|
87
|
+
# A variant case has a name that uniquely identify the case within the
|
88
|
+
# variant and optionally a value.
|
89
|
+
#
|
90
|
+
# @example Constructing variants
|
91
|
+
# # Given the following variant:
|
92
|
+
# # variant filter {
|
93
|
+
# # all,
|
94
|
+
# # none,
|
95
|
+
# # lt(u32),
|
96
|
+
# # }
|
97
|
+
#
|
98
|
+
# Variant.new("all")
|
99
|
+
# Variant.new("none")
|
100
|
+
# Variant.new("lt", 100)
|
101
|
+
class Variant
|
102
|
+
# The name of the variant case
|
103
|
+
# @return [String]
|
104
|
+
attr_reader :name
|
105
|
+
|
106
|
+
# The optional payload of the variant case
|
107
|
+
# @return [Object]
|
108
|
+
attr_reader :value
|
109
|
+
|
110
|
+
# @param name [String] the name of variant case
|
111
|
+
# @param value [Object] the optional payload of the variant case
|
112
|
+
def initialize(name, value = nil)
|
113
|
+
@name = name
|
114
|
+
@value = value
|
115
|
+
end
|
116
|
+
|
117
|
+
def ==(other)
|
118
|
+
eql?(other)
|
119
|
+
end
|
120
|
+
|
121
|
+
def eql?(other)
|
122
|
+
self.class == other.class &&
|
123
|
+
name == other.name &&
|
124
|
+
value == other.value
|
125
|
+
end
|
126
|
+
|
127
|
+
def hash
|
128
|
+
[self.class, @name, @value].hash
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
132
|
+
end
|
data/lib/wasmtime/version.rb
CHANGED
data/lib/wasmtime.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wasmtime
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 28.0.0
|
5
5
|
platform: x64-mingw-ucrt
|
6
6
|
authors:
|
7
7
|
- The Wasmtime Project Developers
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: A Ruby binding for Wasmtime, a WebAssembly runtime.
|
14
14
|
email:
|
@@ -23,6 +23,8 @@ files:
|
|
23
23
|
- lib/wasmtime/3.1/wasmtime_rb.so
|
24
24
|
- lib/wasmtime/3.2/wasmtime_rb.so
|
25
25
|
- lib/wasmtime/3.3/wasmtime_rb.so
|
26
|
+
- lib/wasmtime/3.4/wasmtime_rb.so
|
27
|
+
- lib/wasmtime/component.rb
|
26
28
|
- lib/wasmtime/error.rb
|
27
29
|
- lib/wasmtime/version.rb
|
28
30
|
homepage: https://github.com/BytecodeAlliance/wasmtime-rb
|
@@ -45,14 +47,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
45
47
|
version: '3.1'
|
46
48
|
- - "<"
|
47
49
|
- !ruby/object:Gem::Version
|
48
|
-
version: 3.
|
50
|
+
version: 3.5.dev
|
49
51
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
52
|
requirements:
|
51
53
|
- - ">="
|
52
54
|
- !ruby/object:Gem::Version
|
53
55
|
version: '0'
|
54
56
|
requirements: []
|
55
|
-
rubygems_version: 3.
|
57
|
+
rubygems_version: 3.5.23
|
56
58
|
signing_key:
|
57
59
|
specification_version: 4
|
58
60
|
summary: Wasmtime bindings for Ruby
|