-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2aba63e
commit 0c477af
Showing
11 changed files
with
34 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,54 +56,6 @@ pub mod component { | |
} | ||
} | ||
|
||
#[allow(unused_unsafe, clippy::all)] | ||
pub fn create_struct(fields: &[(_rt::String, &Output)]) -> Output { | ||
unsafe { | ||
let vec2 = fields; | ||
let len2 = vec2.len(); | ||
let layout2 = _rt::alloc::Layout::from_size_align_unchecked(vec2.len() * 12, 4); | ||
let result2 = if layout2.size() != 0 { | ||
let ptr = _rt::alloc::alloc(layout2).cast::<u8>(); | ||
if ptr.is_null() { | ||
_rt::alloc::handle_alloc_error(layout2); | ||
} | ||
ptr | ||
} else { | ||
{ | ||
::core::ptr::null_mut() | ||
} | ||
}; | ||
for (i, e) in vec2.into_iter().enumerate() { | ||
let base = result2.add(i * 12); | ||
{ | ||
let (t0_0, t0_1) = e; | ||
let vec1 = t0_0; | ||
let ptr1 = vec1.as_ptr().cast::<u8>(); | ||
let len1 = vec1.len(); | ||
*base.add(4).cast::<usize>() = len1; | ||
*base.add(0).cast::<*mut u8>() = ptr1.cast_mut(); | ||
*base.add(8).cast::<i32>() = (t0_1).handle() as i32; | ||
} | ||
} | ||
|
||
#[cfg(target_arch = "wasm32")] | ||
#[link(wasm_import_module = "component:pulumi-wasm/[email protected]")] | ||
extern "C" { | ||
#[link_name = "create-struct"] | ||
fn wit_import(_: *mut u8, _: usize) -> i32; | ||
} | ||
|
||
#[cfg(not(target_arch = "wasm32"))] | ||
fn wit_import(_: *mut u8, _: usize) -> i32 { | ||
unreachable!() | ||
} | ||
let ret = wit_import(result2, len2); | ||
if layout2.size() != 0 { | ||
_rt::alloc::dealloc(result2.cast(), layout2); | ||
} | ||
Output::from_handle(ret as u32) | ||
} | ||
} | ||
impl Output { | ||
#[allow(unused_unsafe, clippy::all)] | ||
pub fn new(value: &[u8]) -> Self { | ||
|
@@ -308,8 +260,6 @@ mod _rt { | |
} | ||
} | ||
} | ||
pub use alloc_crate::alloc; | ||
pub use alloc_crate::string::String; | ||
pub use alloc_crate::vec::Vec; | ||
pub unsafe fn invalid_enum_discriminant<T>() -> T { | ||
if cfg!(debug_assertions) { | ||
|
@@ -324,14 +274,13 @@ mod _rt { | |
#[cfg(target_arch = "wasm32")] | ||
#[link_section = "component-type:wit-bindgen:0.20.0:pulumi-rust:encoded world"] | ||
#[doc(hidden)] | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 453] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xc3\x02\x01A\x02\x01\ | ||
A\x02\x01B\x11\x04\0\x06output\x03\x01\x01p}\x01i\0\x01@\x01\x05value\x01\0\x02\x04\ | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 414] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9c\x02\x01A\x02\x01\ | ||
A\x02\x01B\x0d\x04\0\x06output\x03\x01\x01p}\x01i\0\x01@\x01\x05value\x01\0\x02\x04\ | ||
\0\x13[constructor]output\x01\x03\x01h\0\x01@\x02\x04self\x04\x0dfunction-names\0\ | ||
\x02\x04\0\x12[method]output.map\x01\x05\x01k\x01\x01@\x01\x04self\x04\0\x06\x04\ | ||
\0\x12[method]output.get\x01\x07\x01@\x01\x04self\x04\0\x02\x04\0\x18[method]out\ | ||
put.duplicate\x01\x08\x01o\x02s\x04\x01p\x09\x01@\x01\x06fields\x0a\0\x02\x04\0\x0d\ | ||
create-struct\x01\x0b\x03\x01,component:pulumi-wasm/[email protected]\x05\0\ | ||
put.duplicate\x01\x08\x03\x01,component:pulumi-wasm/[email protected]\x05\0\ | ||
\x04\x01'component:pulumi-wasm/[email protected]\x04\0\x0b\x11\x01\0\x0bpulumi-r\ | ||
ust\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10\ | ||
wit-bindgen-rust\x060.20.0"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -191,36 +191,6 @@ pub mod exports { | |
} | ||
} | ||
|
||
#[doc(hidden)] | ||
#[allow(non_snake_case)] | ||
pub unsafe fn _export_create_struct_cabi<T: Guest>( | ||
arg0: *mut u8, | ||
arg1: usize, | ||
) -> i32 { | ||
let base4 = arg0; | ||
let len4 = arg1; | ||
let mut result4 = _rt::Vec::with_capacity(len4); | ||
for i in 0..len4 { | ||
let base = base4.add(i * 12); | ||
let e4 = { | ||
let l0 = *base.add(0).cast::<*mut u8>(); | ||
let l1 = *base.add(4).cast::<usize>(); | ||
let len2 = l1; | ||
let bytes2 = _rt::Vec::from_raw_parts(l0.cast(), len2, len2); | ||
let l3 = *base.add(8).cast::<i32>(); | ||
|
||
( | ||
_rt::string_lift(bytes2), | ||
OutputBorrow::lift(l3 as u32 as usize), | ||
) | ||
}; | ||
result4.push(e4); | ||
} | ||
_rt::cabi_dealloc(base4, len4 * 12, 4); | ||
let result5 = T::create_struct(result4); | ||
(result5).take_handle() as i32 | ||
} | ||
|
||
#[doc(hidden)] | ||
#[allow(non_snake_case)] | ||
pub unsafe fn _export_constructor_output_cabi<T: GuestOutput>( | ||
|
@@ -297,7 +267,6 @@ pub mod exports { | |
} | ||
pub trait Guest { | ||
type Output: GuestOutput; | ||
fn create_struct(fields: _rt::Vec<(_rt::String, OutputBorrow<'_>)>) -> Output; | ||
} | ||
pub trait GuestOutput: 'static { | ||
#[doc(hidden)] | ||
|
@@ -353,11 +322,6 @@ pub mod exports { | |
($ty:ident with_types_in $($path_to_types:tt)*) => (const _: () = { | ||
|
||
|
||
#[export_name = "component:pulumi-wasm/[email protected]#create-struct"] | ||
unsafe extern "C" fn export_create_struct(arg0: *mut u8,arg1: usize,) -> i32 { | ||
$($path_to_types)*::_export_create_struct_cabi::<$ty>(arg0, arg1) | ||
} | ||
|
||
#[export_name = "component:pulumi-wasm/[email protected]#[constructor]output"] | ||
unsafe extern "C" fn export_constructor_output(arg0: *mut u8,arg1: usize,) -> i32 { | ||
$($path_to_types)*::_export_constructor_output_cabi::<<$ty as $($path_to_types)*::Guest>::Output>(arg0, arg1) | ||
|
@@ -779,6 +743,7 @@ mod _rt { | |
String::from_utf8_unchecked(bytes) | ||
} | ||
} | ||
pub use alloc_crate::string::String; | ||
pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { | ||
if size == 0 { | ||
return; | ||
|
@@ -787,7 +752,6 @@ mod _rt { | |
alloc::dealloc(ptr as *mut u8, layout); | ||
} | ||
pub use alloc_crate::alloc; | ||
pub use alloc_crate::string::String; | ||
extern crate alloc as alloc_crate; | ||
} | ||
|
||
|
@@ -824,15 +788,14 @@ pub(crate) use __export_pulumi_wasm_impl as export; | |
#[cfg(target_arch = "wasm32")] | ||
#[link_section = "component-type:wit-bindgen:0.20.0:pulumi-wasm:encoded world"] | ||
#[doc(hidden)] | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1019] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xf9\x06\x01A\x02\x01\ | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 980] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xd2\x06\x01A\x02\x01\ | ||
A\x09\x01B\x03\x01p}\x01@\x01\x07request\0\0\0\x04\0\x11register-resource\x01\x01\ | ||
\x03\x01*component:pulumi-wasm/[email protected]\x05\0\x01B\x11\x04\0\x06outp\ | ||
\x03\x01*component:pulumi-wasm/[email protected]\x05\0\x01B\x0d\x04\0\x06outp\ | ||
ut\x03\x01\x01p}\x01i\0\x01@\x01\x05value\x01\0\x02\x04\0\x13[constructor]output\ | ||
\x01\x03\x01h\0\x01@\x02\x04self\x04\x0dfunction-names\0\x02\x04\0\x12[method]ou\ | ||
tput.map\x01\x05\x01k\x01\x01@\x01\x04self\x04\0\x06\x04\0\x12[method]output.get\ | ||
\x01\x07\x01@\x01\x04self\x04\0\x02\x04\0\x18[method]output.duplicate\x01\x08\x01\ | ||
o\x02s\x04\x01p\x09\x01@\x01\x06fields\x0a\0\x02\x04\0\x0dcreate-struct\x01\x0b\x04\ | ||
\x01\x07\x01@\x01\x04self\x04\0\x02\x04\0\x18[method]output.duplicate\x01\x08\x04\ | ||
\x01,component:pulumi-wasm/[email protected]\x05\x01\x02\x03\0\x01\x06outpu\ | ||
t\x01B\x0b\x02\x03\x02\x01\x02\x04\0\x06output\x03\0\0\x01h\x01\x01r\x01\x06obje\ | ||
ct\x02\x04\0\x0cobject-field\x03\0\x03\x01ps\x01p\x04\x01r\x04\x04types\x04names\ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.