Skip to content

Commit 1ccb97f

Browse files
committed
bless bindgen output
1 parent f9a1348 commit 1ccb97f

File tree

136 files changed

+3000
-984
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+3000
-984
lines changed

crates/component-macro/tests/expanded/char.rs

+29-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ impl<_T> TheWorldPre<_T> {
2727
pub fn new(
2828
instance_pre: wasmtime::component::InstancePre<_T>,
2929
) -> wasmtime::Result<Self> {
30-
let indices = TheWorldIndices::new(instance_pre.component())?;
30+
let indices = TheWorldIndices::new(
31+
instance_pre.component(),
32+
instance_pre.component_type(),
33+
)?;
3134
Ok(Self { instance_pre, indices })
3235
}
3336
pub fn engine(&self) -> &wasmtime::Engine {
@@ -107,9 +110,15 @@ const _: () = {
107110
/// required exports.
108111
pub fn new(
109112
component: &wasmtime::component::Component,
113+
component_type: &wasmtime::component::types::Component,
110114
) -> wasmtime::Result<Self> {
111115
let _component = component;
112-
let interface0 = exports::foo::foo::chars::GuestIndices::new(_component)?;
116+
let _component_type = component_type;
117+
let _instance_type = _component_type.instance_type();
118+
let interface0 = exports::foo::foo::chars::GuestIndices::new(
119+
_component,
120+
_component_type,
121+
)?;
113122
Ok(TheWorldIndices { interface0 })
114123
}
115124
/// Creates a new instance of [`TheWorldIndices`] from an
@@ -124,6 +133,7 @@ const _: () = {
124133
instance: &wasmtime::component::Instance,
125134
) -> wasmtime::Result<Self> {
126135
let _instance = instance;
136+
let _instance_type = _instance.instance_type(&mut store);
127137
let interface0 = exports::foo::foo::chars::GuestIndices::new_instance(
128138
&mut store,
129139
_instance,
@@ -163,7 +173,7 @@ const _: () = {
163173
instance: &wasmtime::component::Instance,
164174
) -> wasmtime::Result<TheWorld> {
165175
let indices = TheWorldIndices::new_instance(&mut store, instance)?;
166-
indices.load(store, instance)
176+
indices.load(&mut store, instance)
167177
}
168178
pub fn add_to_linker<T, U>(
169179
linker: &mut wasmtime::component::Linker<T>,
@@ -281,6 +291,7 @@ pub mod exports {
281291
/// within a component.
282292
pub fn new(
283293
component: &wasmtime::component::Component,
294+
ctype: &wasmtime::component::types::Component,
284295
) -> wasmtime::Result<GuestIndices> {
285296
let instance = component
286297
.get_export_index(None, "foo:foo/chars")
@@ -289,9 +300,11 @@ pub mod exports {
289300
"no exported instance named `foo:foo/chars`"
290301
)
291302
})?;
292-
Self::_new(|name| {
293-
component.get_export_index(Some(&instance), name)
294-
})
303+
let instance_type = ctype.instance_type();
304+
Self::_new(
305+
&instance_type,
306+
|name| component.get_export_index(Some(&instance), name),
307+
)
295308
}
296309
/// This constructor is similar to [`GuestIndices::new`] except that it
297310
/// performs string lookups after instantiation time.
@@ -306,12 +319,17 @@ pub mod exports {
306319
"no exported instance named `foo:foo/chars`"
307320
)
308321
})?;
309-
Self::_new(|name| {
310-
instance
311-
.get_export_index(&mut store, Some(&instance_export), name)
312-
})
322+
let instance_type = instance.instance_type(&mut store);
323+
Self::_new(
324+
&instance_type,
325+
|name| {
326+
instance
327+
.get_export_index(&mut store, Some(&instance_export), name)
328+
},
329+
)
313330
}
314331
fn _new(
332+
_instance_type: &wasmtime::component::__internal::InstanceType,
315333
mut lookup: impl FnMut(
316334
&str,
317335
) -> Option<wasmtime::component::ComponentExportIndex>,
@@ -341,6 +359,7 @@ pub mod exports {
341359
let mut store = store.as_context_mut();
342360
let _ = &mut store;
343361
let _instance = instance;
362+
let _instance_type = _instance.instance_type(&mut store);
344363
let take_char = *_instance
345364
.get_typed_func::<(char,), ()>(&mut store, &self.take_char)?
346365
.func();

crates/component-macro/tests/expanded/char_async.rs

+29-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ impl<_T> TheWorldPre<_T> {
2727
pub fn new(
2828
instance_pre: wasmtime::component::InstancePre<_T>,
2929
) -> wasmtime::Result<Self> {
30-
let indices = TheWorldIndices::new(instance_pre.component())?;
30+
let indices = TheWorldIndices::new(
31+
instance_pre.component(),
32+
instance_pre.component_type(),
33+
)?;
3134
Ok(Self { instance_pre, indices })
3235
}
3336
pub fn engine(&self) -> &wasmtime::Engine {
@@ -110,9 +113,15 @@ const _: () = {
110113
/// required exports.
111114
pub fn new(
112115
component: &wasmtime::component::Component,
116+
component_type: &wasmtime::component::types::Component,
113117
) -> wasmtime::Result<Self> {
114118
let _component = component;
115-
let interface0 = exports::foo::foo::chars::GuestIndices::new(_component)?;
119+
let _component_type = component_type;
120+
let _instance_type = _component_type.instance_type();
121+
let interface0 = exports::foo::foo::chars::GuestIndices::new(
122+
_component,
123+
_component_type,
124+
)?;
116125
Ok(TheWorldIndices { interface0 })
117126
}
118127
/// Creates a new instance of [`TheWorldIndices`] from an
@@ -127,6 +136,7 @@ const _: () = {
127136
instance: &wasmtime::component::Instance,
128137
) -> wasmtime::Result<Self> {
129138
let _instance = instance;
139+
let _instance_type = _instance.instance_type(&mut store);
130140
let interface0 = exports::foo::foo::chars::GuestIndices::new_instance(
131141
&mut store,
132142
_instance,
@@ -169,7 +179,7 @@ const _: () = {
169179
instance: &wasmtime::component::Instance,
170180
) -> wasmtime::Result<TheWorld> {
171181
let indices = TheWorldIndices::new_instance(&mut store, instance)?;
172-
indices.load(store, instance)
182+
indices.load(&mut store, instance)
173183
}
174184
pub fn add_to_linker<T, U>(
175185
linker: &mut wasmtime::component::Linker<T>,
@@ -297,6 +307,7 @@ pub mod exports {
297307
/// within a component.
298308
pub fn new(
299309
component: &wasmtime::component::Component,
310+
ctype: &wasmtime::component::types::Component,
300311
) -> wasmtime::Result<GuestIndices> {
301312
let instance = component
302313
.get_export_index(None, "foo:foo/chars")
@@ -305,9 +316,11 @@ pub mod exports {
305316
"no exported instance named `foo:foo/chars`"
306317
)
307318
})?;
308-
Self::_new(|name| {
309-
component.get_export_index(Some(&instance), name)
310-
})
319+
let instance_type = ctype.instance_type();
320+
Self::_new(
321+
&instance_type,
322+
|name| component.get_export_index(Some(&instance), name),
323+
)
311324
}
312325
/// This constructor is similar to [`GuestIndices::new`] except that it
313326
/// performs string lookups after instantiation time.
@@ -322,12 +335,17 @@ pub mod exports {
322335
"no exported instance named `foo:foo/chars`"
323336
)
324337
})?;
325-
Self::_new(|name| {
326-
instance
327-
.get_export_index(&mut store, Some(&instance_export), name)
328-
})
338+
let instance_type = instance.instance_type(&mut store);
339+
Self::_new(
340+
&instance_type,
341+
|name| {
342+
instance
343+
.get_export_index(&mut store, Some(&instance_export), name)
344+
},
345+
)
329346
}
330347
fn _new(
348+
_instance_type: &wasmtime::component::__internal::InstanceType,
331349
mut lookup: impl FnMut(
332350
&str,
333351
) -> Option<wasmtime::component::ComponentExportIndex>,
@@ -357,6 +375,7 @@ pub mod exports {
357375
let mut store = store.as_context_mut();
358376
let _ = &mut store;
359377
let _instance = instance;
378+
let _instance_type = _instance.instance_type(&mut store);
360379
let take_char = *_instance
361380
.get_typed_func::<(char,), ()>(&mut store, &self.take_char)?
362381
.func();

crates/component-macro/tests/expanded/char_concurrent.rs

+29-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ impl<_T> TheWorldPre<_T> {
2727
pub fn new(
2828
instance_pre: wasmtime::component::InstancePre<_T>,
2929
) -> wasmtime::Result<Self> {
30-
let indices = TheWorldIndices::new(instance_pre.component())?;
30+
let indices = TheWorldIndices::new(
31+
instance_pre.component(),
32+
instance_pre.component_type(),
33+
)?;
3134
Ok(Self { instance_pre, indices })
3235
}
3336
pub fn engine(&self) -> &wasmtime::Engine {
@@ -110,9 +113,15 @@ const _: () = {
110113
/// required exports.
111114
pub fn new(
112115
component: &wasmtime::component::Component,
116+
component_type: &wasmtime::component::types::Component,
113117
) -> wasmtime::Result<Self> {
114118
let _component = component;
115-
let interface0 = exports::foo::foo::chars::GuestIndices::new(_component)?;
119+
let _component_type = component_type;
120+
let _instance_type = _component_type.instance_type();
121+
let interface0 = exports::foo::foo::chars::GuestIndices::new(
122+
_component,
123+
_component_type,
124+
)?;
116125
Ok(TheWorldIndices { interface0 })
117126
}
118127
/// Creates a new instance of [`TheWorldIndices`] from an
@@ -127,6 +136,7 @@ const _: () = {
127136
instance: &wasmtime::component::Instance,
128137
) -> wasmtime::Result<Self> {
129138
let _instance = instance;
139+
let _instance_type = _instance.instance_type(&mut store);
130140
let interface0 = exports::foo::foo::chars::GuestIndices::new_instance(
131141
&mut store,
132142
_instance,
@@ -169,7 +179,7 @@ const _: () = {
169179
instance: &wasmtime::component::Instance,
170180
) -> wasmtime::Result<TheWorld> {
171181
let indices = TheWorldIndices::new_instance(&mut store, instance)?;
172-
indices.load(store, instance)
182+
indices.load(&mut store, instance)
173183
}
174184
pub fn add_to_linker<T, U>(
175185
linker: &mut wasmtime::component::Linker<T>,
@@ -374,6 +384,7 @@ pub mod exports {
374384
/// within a component.
375385
pub fn new(
376386
component: &wasmtime::component::Component,
387+
ctype: &wasmtime::component::types::Component,
377388
) -> wasmtime::Result<GuestIndices> {
378389
let instance = component
379390
.get_export_index(None, "foo:foo/chars")
@@ -382,9 +393,11 @@ pub mod exports {
382393
"no exported instance named `foo:foo/chars`"
383394
)
384395
})?;
385-
Self::_new(|name| {
386-
component.get_export_index(Some(&instance), name)
387-
})
396+
let instance_type = ctype.instance_type();
397+
Self::_new(
398+
&instance_type,
399+
|name| component.get_export_index(Some(&instance), name),
400+
)
388401
}
389402
/// This constructor is similar to [`GuestIndices::new`] except that it
390403
/// performs string lookups after instantiation time.
@@ -399,12 +412,17 @@ pub mod exports {
399412
"no exported instance named `foo:foo/chars`"
400413
)
401414
})?;
402-
Self::_new(|name| {
403-
instance
404-
.get_export_index(&mut store, Some(&instance_export), name)
405-
})
415+
let instance_type = instance.instance_type(&mut store);
416+
Self::_new(
417+
&instance_type,
418+
|name| {
419+
instance
420+
.get_export_index(&mut store, Some(&instance_export), name)
421+
},
422+
)
406423
}
407424
fn _new(
425+
_instance_type: &wasmtime::component::__internal::InstanceType,
408426
mut lookup: impl FnMut(
409427
&str,
410428
) -> Option<wasmtime::component::ComponentExportIndex>,
@@ -434,6 +452,7 @@ pub mod exports {
434452
let mut store = store.as_context_mut();
435453
let _ = &mut store;
436454
let _instance = instance;
455+
let _instance_type = _instance.instance_type(&mut store);
437456
let take_char = *_instance
438457
.get_typed_func::<(char,), ()>(&mut store, &self.take_char)?
439458
.func();

crates/component-macro/tests/expanded/char_tracing_async.rs

+29-10
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ impl<_T> TheWorldPre<_T> {
2727
pub fn new(
2828
instance_pre: wasmtime::component::InstancePre<_T>,
2929
) -> wasmtime::Result<Self> {
30-
let indices = TheWorldIndices::new(instance_pre.component())?;
30+
let indices = TheWorldIndices::new(
31+
instance_pre.component(),
32+
instance_pre.component_type(),
33+
)?;
3134
Ok(Self { instance_pre, indices })
3235
}
3336
pub fn engine(&self) -> &wasmtime::Engine {
@@ -110,9 +113,15 @@ const _: () = {
110113
/// required exports.
111114
pub fn new(
112115
component: &wasmtime::component::Component,
116+
component_type: &wasmtime::component::types::Component,
113117
) -> wasmtime::Result<Self> {
114118
let _component = component;
115-
let interface0 = exports::foo::foo::chars::GuestIndices::new(_component)?;
119+
let _component_type = component_type;
120+
let _instance_type = _component_type.instance_type();
121+
let interface0 = exports::foo::foo::chars::GuestIndices::new(
122+
_component,
123+
_component_type,
124+
)?;
116125
Ok(TheWorldIndices { interface0 })
117126
}
118127
/// Creates a new instance of [`TheWorldIndices`] from an
@@ -127,6 +136,7 @@ const _: () = {
127136
instance: &wasmtime::component::Instance,
128137
) -> wasmtime::Result<Self> {
129138
let _instance = instance;
139+
let _instance_type = _instance.instance_type(&mut store);
130140
let interface0 = exports::foo::foo::chars::GuestIndices::new_instance(
131141
&mut store,
132142
_instance,
@@ -169,7 +179,7 @@ const _: () = {
169179
instance: &wasmtime::component::Instance,
170180
) -> wasmtime::Result<TheWorld> {
171181
let indices = TheWorldIndices::new_instance(&mut store, instance)?;
172-
indices.load(store, instance)
182+
indices.load(&mut store, instance)
173183
}
174184
pub fn add_to_linker<T, U>(
175185
linker: &mut wasmtime::component::Linker<T>,
@@ -326,6 +336,7 @@ pub mod exports {
326336
/// within a component.
327337
pub fn new(
328338
component: &wasmtime::component::Component,
339+
ctype: &wasmtime::component::types::Component,
329340
) -> wasmtime::Result<GuestIndices> {
330341
let instance = component
331342
.get_export_index(None, "foo:foo/chars")
@@ -334,9 +345,11 @@ pub mod exports {
334345
"no exported instance named `foo:foo/chars`"
335346
)
336347
})?;
337-
Self::_new(|name| {
338-
component.get_export_index(Some(&instance), name)
339-
})
348+
let instance_type = ctype.instance_type();
349+
Self::_new(
350+
&instance_type,
351+
|name| component.get_export_index(Some(&instance), name),
352+
)
340353
}
341354
/// This constructor is similar to [`GuestIndices::new`] except that it
342355
/// performs string lookups after instantiation time.
@@ -351,12 +364,17 @@ pub mod exports {
351364
"no exported instance named `foo:foo/chars`"
352365
)
353366
})?;
354-
Self::_new(|name| {
355-
instance
356-
.get_export_index(&mut store, Some(&instance_export), name)
357-
})
367+
let instance_type = instance.instance_type(&mut store);
368+
Self::_new(
369+
&instance_type,
370+
|name| {
371+
instance
372+
.get_export_index(&mut store, Some(&instance_export), name)
373+
},
374+
)
358375
}
359376
fn _new(
377+
_instance_type: &wasmtime::component::__internal::InstanceType,
360378
mut lookup: impl FnMut(
361379
&str,
362380
) -> Option<wasmtime::component::ComponentExportIndex>,
@@ -386,6 +404,7 @@ pub mod exports {
386404
let mut store = store.as_context_mut();
387405
let _ = &mut store;
388406
let _instance = instance;
407+
let _instance_type = _instance.instance_type(&mut store);
389408
let take_char = *_instance
390409
.get_typed_func::<(char,), ()>(&mut store, &self.take_char)?
391410
.func();

0 commit comments

Comments
 (0)