Home
last modified time | relevance | path

Searched refs:ResourceType (Results 1 – 25 of 36) sorted by relevance

12

/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/resources/
H A Dty.rs23 pub struct ResourceType { struct
27 impl ResourceType { impl
44 pub fn host<T: 'static>() -> ResourceType { in host() argument
45 ResourceType { in host()
62 pub fn host_dynamic(payload: u32) -> ResourceType { in host_dynamic() argument
63 ResourceType { in host_dynamic()
72 ) -> ResourceType { in guest() argument
73 ResourceType { in guest()
82 pub(crate) fn uninstantiated(types: &ComponentTypes, index: ResourceIndex) -> ResourceType { in uninstantiated() argument
83 ResourceType { in uninstantiated()
[all …]
H A Dhost_dynamic.rs5 use crate::component::{ComponentType, Lift, Lower, ResourceAny, ResourceType};
71 fn resource_type(ty: u32) -> ResourceType { in resource_type() argument
72 ResourceType::host_dynamic(ty) in resource_type()
75 fn typecheck(ty: ResourceType) -> Option<u32> { in typecheck()
H A Dhost_static.rs15 use crate::component::{ComponentType, Lift, Lower, ResourceAny, ResourceType};
145 fn resource_type((): ()) -> ResourceType { in resource_type() argument
146 ResourceType::host::<T>() in resource_type()
149 fn typecheck(ty: ResourceType) -> Option<()> { in typecheck()
H A Dany.rs16 use crate::component::{ComponentType, Lift, Lower, Resource, ResourceDynamic, ResourceType};
51 ty: ResourceType,
56 pub(crate) fn new(idx: HostResourceIndex, ty: ResourceType, owned: bool) -> ResourceAny { in new() argument
132 pub fn ty(&self) -> ResourceType { in ty() argument
H A Dhost.rs5 use crate::component::{ComponentType, Lift, Lower, ResourceAny, ResourceType};
34 fn typecheck(ty: ResourceType) -> Option<D>; in typecheck()
36 fn resource_type(data: D) -> ResourceType; in resource_type() argument
/wasmtime-44.0.1/tests/all/component_model/
H A Dresources.rs36 assert!(ResourceType::host::<T>() != ResourceType::host::<U>()); in host_resource_types()
54 assert_eq!(t1, ResourceType::host::<T>()); in host_resource_types()
55 assert_eq!(t2, ResourceType::host::<T>()); in host_resource_types()
56 assert_eq!(t3, ResourceType::host::<T>()); in host_resource_types()
57 assert_eq!(t4, ResourceType::host::<T>()); in host_resource_types()
58 assert_eq!(u1, ResourceType::host::<U>()); in host_resource_types()
59 assert_eq!(u2, ResourceType::host::<U>()); in host_resource_types()
540 ("x", Type::Own(ResourceType::host::<MyType>())) in dynamic_type()
600 assert_eq!(t1.ty(), ResourceType::host::<MyType>()); in dynamic_val()
1505 assert_eq!(t1, ResourceType::host::<MyType>()); in guest_different_host_same()
[all …]
H A Dlinker.rs3 use wasmtime::component::{Component, Linker, ResourceType};
11 let ty = ResourceType::host::<u32>(); in old_import_importing_new_item()
34 let ty = ResourceType::host::<u32>(); in new_import_importing_old_item()
57 let t1 = ResourceType::host::<u32>(); in import_both_old_and_new()
58 let t2 = ResourceType::host::<i32>(); in import_both_old_and_new()
85 let t1 = ResourceType::host::<u32>(); in missing_import_selects_max()
86 let t2 = ResourceType::host::<i32>(); in missing_import_selects_max()
/wasmtime-44.0.1/crates/c-api/src/component/types/
H A Dresource.rs1 use wasmtime::component::ResourceType;
6 pub(crate) ty: ResourceType,
19 ty: ResourceType::host_dynamic(ty), in wasmtime_component_resource_type_new_host()
/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/
H A Dmatching.rs2 use crate::component::ResourceType;
21 pub imported_resources: Arc<PrimaryMap<ResourceIndex, ResourceType>>,
28 pub resources: &'a Arc<PrimaryMap<ResourceIndex, ResourceType>>,
197 pub fn resource_type(&self, index: TypeResourceTableIndex) -> ResourceType { in resource_type() argument
203 .unwrap_or_else(|| ResourceType::uninstantiated(&self.types, ty)), in resource_type()
204 TypeResourceTable::Abstract(ty) => ResourceType::abstract_(&self.types, ty), in resource_type()
H A Dtypes.rs19 pub use crate::component::resources::ResourceType;
43 resources: Arc<PrimaryMap<ResourceIndex, ResourceType>>,
97 a_resource: &'a PrimaryMap<ResourceIndex, ResourceType>,
99 b_resource: &'a PrimaryMap<ResourceIndex, ResourceType>,
731 Own(ResourceType),
732 Borrow(ResourceType),
848 pub fn unwrap_own(&self) -> &ResourceType { in unwrap_own() argument
860 pub fn unwrap_borrow(&self) -> &ResourceType { in unwrap_borrow() argument
1126 Resource(ResourceType),
1161 None => ResourceType::uninstantiated(&ty.types, resource_index), in from()
[all …]
H A Dlinker.rs8 Component, ComponentNamedList, Instance, InstancePre, Lift, Lower, ResourceType, Val,
109 Resource(ResourceType, Arc<crate::func::HostFunc>),
353 let ty = crate::component::ResourceType::host::<()>(); in define_unknown_imports_as_traps()
738 ty: ResourceType, in resource() argument
751 pub fn resource_async<F>(&mut self, name: &str, ty: ResourceType, dtor: F) -> Result<()> in resource_async() argument
769 pub fn resource_concurrent<F>(&mut self, name: &str, ty: ResourceType, dtor: F) -> Result<()> in resource_concurrent() argument
H A Dinstance.rs6 Component, ComponentExportIndex, ComponentNamedList, Func, Lift, Lower, ResourceType,
259 ) -> Option<ResourceType> { in get_resource() argument
698 ty: ResourceType,
718 pub type ImportedResources = PrimaryMap<ResourceIndex, ResourceType>;
929 let ty = ResourceType::guest(store.id(), instance, resource.index); in resource()
1091 resource_types: Arc<PrimaryMap<ResourceIndex, ResourceType>>,
1119 resource_types: Arc<PrimaryMap<ResourceIndex, ResourceType>>, in new_unchecked() argument
H A Dmod.rs135 pub use self::types::{ResourceType, Type};
/wasmtime-44.0.1/crates/c-api/include/wasmtime/component/types/
H A Dval.hh151 class ResourceType { class
152 WASMTIME_CLONE_EQUAL_WRAPPER(ResourceType, wasmtime_component_resource_type);
157 explicit ResourceType(uint32_t ty) in ResourceType() function in wasmtime::component::ResourceType
371 static ValType new_own(ResourceType own) { in new_own()
379 static ValType new_borrow(ResourceType borrow) { in new_borrow()
555 const ResourceType &own() const { in own()
557 return *ResourceType::from_capi(&ty.of.own); in own()
561 const ResourceType &borrow() const { in borrow()
563 return *ResourceType::from_capi(&ty.of.borrow); in borrow()
H A Dcomponent.hh62 class ResourceType;
159 const ResourceType &resource() const;
255 inline const wasmtime::component::ResourceType &
258 return *ResourceType::from_capi(&item.of.resource); in resource()
/wasmtime-44.0.1/crates/wast/src/
H A Dspectest.rs94 use wasmtime::component::{Resource, ResourceType}; in link_component_spectest()
132 i.resource("resource1", ResourceType::host::<Resource1>(), { in link_component_spectest()
143 ResourceType::host::<Resource2>(), in link_component_spectest()
151 ResourceType::host::<Resource1>(), in link_component_spectest()
/wasmtime-44.0.1/crates/wasmtime/src/runtime/component/func/
H A Doptions.rs7 use crate::component::{Instance, ResourceType, RuntimeInstance};
271 pub fn resource_type(&self, ty: TypeResourceTableIndex) -> ResourceType { in resource_type() argument
448 pub fn resource_type(&self, ty: TypeResourceTableIndex) -> ResourceType { in resource_type() argument
/wasmtime-44.0.1/crates/wasmtime/src/runtime/vm/
H A Dcomponent.rs10 use crate::component::{Component, Instance, InstancePre, ResourceType, RuntimeImport};
140 resource_types: Arc<PrimaryMap<ResourceIndex, ResourceType>>,
321 resource_types: Arc<PrimaryMap<ResourceIndex, ResourceType>>, in new() argument
826 pub fn resource_types(&self) -> &Arc<PrimaryMap<ResourceIndex, ResourceType>> { in resource_types() argument
833 ) -> &mut Arc<PrimaryMap<ResourceIndex, ResourceType>> { in resource_types_mut() argument
/wasmtime-44.0.1/crates/c-api/tests/component/
H A Dvalues.cc860 EXPECT_EQ(f.type(), ResourceType(RESOURCE_TYPE)); in TEST()
876 "r", ResourceType(RESOURCE_TYPE), in TEST()
1016 EXPECT_NE(resource1.type(), ResourceType(100)); in TEST()
1017 EXPECT_NE(resource2.type(), ResourceType(100)); in TEST()
1077 ResourceType t3 = r3.type(); in TEST()
1078 EXPECT_EQ(t3, ResourceType(2)); in TEST()
1092 EXPECT_EQ(r5.type(), ResourceType(2)); in TEST()
/wasmtime-44.0.1/crates/component-macro/tests/expanded/
H A Dunstable-features.rs290 wasmtime::component::ResourceType::host::<Baz>(), in add_to_linker_imports()
447 wasmtime::component::ResourceType::host::<Bar>(), in add_to_linker()
H A Dunstable-features_concurrent.rs281 wasmtime::component::ResourceType::host::<Baz>(), in add_to_linker_imports()
433 wasmtime::component::ResourceType::host::<Bar>(), in add_to_linker()
H A Dresources-import.rs270 wasmtime::component::ResourceType::host::<WorldResource>(), in add_to_linker_imports()
680 wasmtime::component::ResourceType::host::<Bar>(), in add_to_linker()
690 wasmtime::component::ResourceType::host::<Fallible>(), in add_to_linker()
985 wasmtime::component::ResourceType::host::<A>(), in add_to_linker()
1129 wasmtime::component::ResourceType::host::<Foo>(), in add_to_linker()
H A Dunstable-features_async.rs302 wasmtime::component::ResourceType::host::<Baz>(), in add_to_linker_imports()
474 wasmtime::component::ResourceType::host::<Bar>(), in add_to_linker()
H A Dresources-import_concurrent.rs257 wasmtime::component::ResourceType::host::<WorldResource>(), in add_to_linker_imports()
587 wasmtime::component::ResourceType::host::<Bar>(), in add_to_linker()
603 wasmtime::component::ResourceType::host::<Fallible>(), in add_to_linker()
952 wasmtime::component::ResourceType::host::<A>(), in add_to_linker()
1091 wasmtime::component::ResourceType::host::<Foo>(), in add_to_linker()
/wasmtime-44.0.1/crates/c-api/include/wasmtime/component/
H A Dlinker.hh131 const ResourceType &ty, F &&f) { in add_resource()

12