From 0b6e14648877e4a7913d55d9b96d391d7ecc2073 Mon Sep 17 00:00:00 2001 From: Andrzej Ressel Date: Tue, 5 Mar 2024 01:25:12 +0100 Subject: [PATCH] Save --- pulumi_rust_wasm/src/output.rs | 14 ++++++++++++-- pulumi_wasm_main/src/bindings.rs | 15 ++++++--------- pulumi_wasm_main/src/lib.rs | 21 +++++++++------------ pulumi_wasm_main/src/random.rs | 26 ++++++++++++++++++++++++++ pulumi_wasm_random/src/bindings.rs | 24 +++++++----------------- pulumi_wasm_random/src/lib.rs | 18 +++++++++--------- wits/world.wit | 2 +- 7 files changed, 70 insertions(+), 50 deletions(-) create mode 100644 pulumi_wasm_main/src/random.rs diff --git a/pulumi_rust_wasm/src/output.rs b/pulumi_rust_wasm/src/output.rs index 8dd92a15d..cb782b565 100644 --- a/pulumi_rust_wasm/src/output.rs +++ b/pulumi_rust_wasm/src/output.rs @@ -7,12 +7,22 @@ pub struct Output { future: output_interface::Output, // pulumi: Rc, } +// +// impl Into> for (T,) { +// fn into(self) -> Output { +// Output::new(&self) +// } +// } - +impl From for Output { + fn from(value: T) -> Output { + Output::new(&value) + } +} impl Output { - pub fn get_inner(&self) -> &output_interface::Output { + pub unsafe fn get_inner(&self) -> &output_interface::Output { &self.future } diff --git a/pulumi_wasm_main/src/bindings.rs b/pulumi_wasm_main/src/bindings.rs index 848b240c4..cfd298b73 100644 --- a/pulumi_wasm_main/src/bindings.rs +++ b/pulumi_wasm_main/src/bindings.rs @@ -228,7 +228,7 @@ pub mod component { pub type Output = super::super::super::component::pulumi_wasm::output_interface::Output; pub struct RandomStringArgs<'a,> { pub name: wit_bindgen::rt::string::String, - pub length: Result, + pub length: &'a Output, } impl<'a,> ::core::fmt::Debug for RandomStringArgs<'a,> { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { @@ -246,20 +246,17 @@ pub mod component { let vec1 = name0; let ptr1 = vec1.as_ptr() as i32; let len1 = vec1.len() as i32; - let (result2_0,result2_1,) = match length0 { - Ok(e) => { (0i32, wit_bindgen::rt::as_i32(e)) }, - Err(e) => { (1i32, (e).handle() as i32) }, - }; + #[cfg(target_arch = "wasm32")] #[link(wasm_import_module = "component:pulumi-wasm/pulumi-provider-random-interface@0.1.0")] extern "C" { #[link_name = "create-random-string"] - fn wit_import(_: i32, _: i32, _: i32, _: i32, ); + fn wit_import(_: i32, _: i32, _: i32, ); } #[cfg(not(target_arch = "wasm32"))] - fn wit_import(_: i32, _: i32, _: i32, _: i32, ){ unreachable!() } - wit_import(ptr1, len1, result2_0, result2_1); + fn wit_import(_: i32, _: i32, _: i32, ){ unreachable!() } + wit_import(ptr1, len1, (length0).handle() as i32); } } #[allow(unused_unsafe, clippy::all)] @@ -336,7 +333,7 @@ pub mod exports { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:new-main"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 803] = [0, 97, 115, 109, 13, 0, 1, 0, 0, 25, 22, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 4, 0, 7, 165, 5, 1, 65, 2, 1, 65, 7, 1, 66, 17, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 1, 1, 112, 125, 1, 105, 0, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 0, 2, 4, 0, 19, 91, 99, 111, 110, 115, 116, 114, 117, 99, 116, 111, 114, 93, 111, 117, 116, 112, 117, 116, 1, 3, 1, 104, 0, 1, 64, 2, 4, 115, 101, 108, 102, 4, 13, 102, 117, 110, 99, 116, 105, 111, 110, 45, 110, 97, 109, 101, 115, 0, 2, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 109, 97, 112, 1, 5, 1, 107, 1, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 6, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 103, 101, 116, 1, 7, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 2, 4, 0, 24, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 100, 117, 112, 108, 105, 99, 97, 116, 101, 1, 8, 1, 111, 2, 115, 4, 1, 112, 9, 1, 64, 1, 6, 102, 105, 101, 108, 100, 115, 10, 0, 2, 4, 0, 13, 99, 114, 101, 97, 116, 101, 45, 115, 116, 114, 117, 99, 116, 1, 11, 3, 1, 44, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 111, 117, 116, 112, 117, 116, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 0, 2, 3, 0, 0, 6, 111, 117, 116, 112, 117, 116, 1, 66, 17, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 107, 121, 1, 104, 1, 1, 107, 3, 1, 113, 2, 7, 108, 105, 116, 101, 114, 97, 108, 1, 2, 0, 3, 114, 101, 115, 1, 4, 0, 4, 0, 10, 101, 105, 116, 104, 101, 114, 45, 117, 51, 50, 3, 0, 5, 1, 106, 1, 121, 1, 3, 1, 114, 2, 4, 110, 97, 109, 101, 115, 6, 108, 101, 110, 103, 116, 104, 7, 4, 0, 18, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 97, 114, 103, 115, 3, 0, 8, 1, 105, 1, 1, 114, 2, 3, 117, 114, 108, 10, 6, 114, 101, 115, 117, 108, 116, 10, 4, 0, 20, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 114, 101, 115, 117, 108, 116, 3, 0, 11, 1, 64, 1, 4, 97, 114, 103, 115, 9, 1, 0, 4, 0, 20, 99, 114, 101, 97, 116, 101, 45, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 1, 13, 1, 64, 0, 1, 0, 4, 0, 16, 104, 97, 110, 100, 108, 101, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 1, 14, 3, 1, 60, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 2, 1, 66, 2, 1, 64, 0, 1, 0, 4, 0, 4, 109, 97, 105, 110, 1, 0, 4, 1, 39, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 109, 97, 105, 110, 64, 48, 46, 49, 46, 48, 5, 3, 4, 1, 36, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 110, 101, 119, 45, 109, 97, 105, 110, 64, 48, 46, 49, 46, 48, 4, 0, 11, 14, 1, 0, 8, 110, 101, 119, 45, 109, 97, 105, 110, 3, 0, 0, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 50, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 56, 46, 48]; +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 797] = [0, 97, 115, 109, 13, 0, 1, 0, 0, 25, 22, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 4, 0, 7, 159, 5, 1, 65, 2, 1, 65, 7, 1, 66, 17, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 1, 1, 112, 125, 1, 105, 0, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 0, 2, 4, 0, 19, 91, 99, 111, 110, 115, 116, 114, 117, 99, 116, 111, 114, 93, 111, 117, 116, 112, 117, 116, 1, 3, 1, 104, 0, 1, 64, 2, 4, 115, 101, 108, 102, 4, 13, 102, 117, 110, 99, 116, 105, 111, 110, 45, 110, 97, 109, 101, 115, 0, 2, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 109, 97, 112, 1, 5, 1, 107, 1, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 6, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 103, 101, 116, 1, 7, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 2, 4, 0, 24, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 100, 117, 112, 108, 105, 99, 97, 116, 101, 1, 8, 1, 111, 2, 115, 4, 1, 112, 9, 1, 64, 1, 6, 102, 105, 101, 108, 100, 115, 10, 0, 2, 4, 0, 13, 99, 114, 101, 97, 116, 101, 45, 115, 116, 114, 117, 99, 116, 1, 11, 3, 1, 44, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 111, 117, 116, 112, 117, 116, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 0, 2, 3, 0, 0, 6, 111, 117, 116, 112, 117, 116, 1, 66, 16, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 107, 121, 1, 104, 1, 1, 107, 3, 1, 113, 2, 7, 108, 105, 116, 101, 114, 97, 108, 1, 2, 0, 3, 114, 101, 115, 1, 4, 0, 4, 0, 10, 101, 105, 116, 104, 101, 114, 45, 117, 51, 50, 3, 0, 5, 1, 114, 2, 4, 110, 97, 109, 101, 115, 6, 108, 101, 110, 103, 116, 104, 3, 4, 0, 18, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 97, 114, 103, 115, 3, 0, 7, 1, 105, 1, 1, 114, 2, 3, 117, 114, 108, 9, 6, 114, 101, 115, 117, 108, 116, 9, 4, 0, 20, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 114, 101, 115, 117, 108, 116, 3, 0, 10, 1, 64, 1, 4, 97, 114, 103, 115, 8, 1, 0, 4, 0, 20, 99, 114, 101, 97, 116, 101, 45, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 1, 12, 1, 64, 0, 1, 0, 4, 0, 16, 104, 97, 110, 100, 108, 101, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 1, 13, 3, 1, 60, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 2, 1, 66, 2, 1, 64, 0, 1, 0, 4, 0, 4, 109, 97, 105, 110, 1, 0, 4, 1, 39, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 109, 97, 105, 110, 64, 48, 46, 49, 46, 48, 5, 3, 4, 1, 36, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 110, 101, 119, 45, 109, 97, 105, 110, 64, 48, 46, 49, 46, 48, 4, 0, 11, 14, 1, 0, 8, 110, 101, 119, 45, 109, 97, 105, 110, 3, 0, 0, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 50, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 56, 46, 48]; #[inline(never)] #[doc(hidden)] diff --git a/pulumi_wasm_main/src/lib.rs b/pulumi_wasm_main/src/lib.rs index 58a9b57fd..4473dae96 100644 --- a/pulumi_wasm_main/src/lib.rs +++ b/pulumi_wasm_main/src/lib.rs @@ -1,11 +1,10 @@ use crate::bindings::exports::component::pulumi_wasm::pulumi_main::Guest; -use bindings::component::pulumi_wasm::pulumi_provider_random_interface::{ - create_random_string, RandomStringArgs, -}; + use pulumi_rust_wasm::output::Output; -use crate::bindings::component::pulumi_wasm::pulumi_provider_random_interface; +use crate::random::*; mod bindings; +mod random; struct Component {} @@ -13,14 +12,12 @@ impl Guest for Component { fn main() { let length: Output = Output::new(&1234); - let output_1 = length.get_inner(); - let output_2 = output_1.duplicate(); - let output_2 = unsafe { pulumi_provider_random_interface::Output::from_handle(output_2.into_handle()) }; - - let abc = RandomStringArgs { + // let output_1 = length.get_inner(); + // let output_2 = output_1.duplicate(); + // let output_2 = unsafe { pulumi_provider_random_interface::Output::from_handle(output_2.into_handle()) }; + create_random_string(RandomStringArgs { name: "test1234".to_string(), - length: Err(&output_2), - }; - create_random_string(abc); + length: 3.into(), + }); } } diff --git a/pulumi_wasm_main/src/random.rs b/pulumi_wasm_main/src/random.rs new file mode 100644 index 000000000..177fd6f49 --- /dev/null +++ b/pulumi_wasm_main/src/random.rs @@ -0,0 +1,26 @@ +use pulumi_rust_wasm::output::Output; +use crate::bindings::component::pulumi_wasm::{output_interface, pulumi_provider_random_interface}; + +pub struct RandomStringArgs { + pub(crate) name: String, + pub(crate) length: Output, +} + +pub fn create_random_string( + args: RandomStringArgs, +) { + let length = clone(args.length); + let args = pulumi_provider_random_interface::RandomStringArgs { + name: args.name, + length: &length, + }; + pulumi_provider_random_interface::create_random_string(args); +} + +fn clone(output: Output) -> output_interface::Output { + unsafe { + let inner = output.get_inner(); + let cloned = inner.duplicate(); + pulumi_provider_random_interface::Output::from_handle(cloned.into_handle()) + } +} \ No newline at end of file diff --git a/pulumi_wasm_random/src/bindings.rs b/pulumi_wasm_random/src/bindings.rs index 090909b91..1ed0b842f 100644 --- a/pulumi_wasm_random/src/bindings.rs +++ b/pulumi_wasm_random/src/bindings.rs @@ -341,7 +341,7 @@ pub mod exports { pub type Output = super::super::super::super::component::pulumi_wasm::output_interface::Output; pub struct RandomStringArgs<'a,> { pub name: wit_bindgen::rt::string::String, - pub length: Result, + pub length: &'a Output, } impl<'a,> ::core::fmt::Debug for RandomStringArgs<'a,> { fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { @@ -353,7 +353,7 @@ pub mod exports { #[doc(hidden)] #[export_name = "component:pulumi-wasm/pulumi-provider-random-interface@0.1.0#create-random-string"] #[allow(non_snake_case)] - unsafe extern "C" fn __export_create_random_string(arg0: i32,arg1: i32,arg2: i32,arg3: i32,) { + unsafe extern "C" fn __export_create_random_string(arg0: i32,arg1: i32,arg2: i32,) { #[allow(unused_imports)] use wit_bindgen::rt::{alloc, vec::Vec, string::String}; @@ -376,20 +376,10 @@ pub mod exports { let bytes0 = Vec::from_raw_parts(arg0 as *mut _, len0, len0); <_GuestImpl as Guest>::create_random_string(RandomStringArgs{ name: wit_bindgen::rt::string_lift(bytes0), - length: match arg2 { - 0 => { - let e = arg3 as u32; - Ok(e) - } - 1 => { - let e = { - - handle1 = super::super::super::super::component::pulumi_wasm::output_interface::Output::from_handle(arg3 as u32); - &handle1 - }; - Err(e) - } - _ => wit_bindgen::rt::invalid_enum_discriminant(), + length: { + + handle1 = super::super::super::super::component::pulumi_wasm::output_interface::Output::from_handle(arg2 as u32); + &handle1 }, }); } @@ -436,7 +426,7 @@ pub mod exports { #[cfg(target_arch = "wasm32")] #[link_section = "component-type:pulumi-provider-random"] #[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 974] = [0, 97, 115, 109, 13, 0, 1, 0, 0, 25, 22, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 4, 0, 7, 194, 6, 1, 65, 2, 1, 65, 7, 1, 66, 17, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 1, 1, 112, 125, 1, 105, 0, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 0, 2, 4, 0, 19, 91, 99, 111, 110, 115, 116, 114, 117, 99, 116, 111, 114, 93, 111, 117, 116, 112, 117, 116, 1, 3, 1, 104, 0, 1, 64, 2, 4, 115, 101, 108, 102, 4, 13, 102, 117, 110, 99, 116, 105, 111, 110, 45, 110, 97, 109, 101, 115, 0, 2, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 109, 97, 112, 1, 5, 1, 107, 1, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 6, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 103, 101, 116, 1, 7, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 2, 4, 0, 24, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 100, 117, 112, 108, 105, 99, 97, 116, 101, 1, 8, 1, 111, 2, 115, 4, 1, 112, 9, 1, 64, 1, 6, 102, 105, 101, 108, 100, 115, 10, 0, 2, 4, 0, 13, 99, 114, 101, 97, 116, 101, 45, 115, 116, 114, 117, 99, 116, 1, 11, 3, 1, 44, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 111, 117, 116, 112, 117, 116, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 0, 2, 3, 0, 0, 6, 111, 117, 116, 112, 117, 116, 1, 66, 11, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 104, 1, 1, 114, 1, 6, 111, 98, 106, 101, 99, 116, 2, 4, 0, 12, 111, 98, 106, 101, 99, 116, 45, 102, 105, 101, 108, 100, 3, 0, 3, 1, 112, 115, 1, 112, 4, 1, 114, 4, 4, 116, 121, 112, 101, 115, 4, 110, 97, 109, 101, 115, 12, 111, 98, 106, 101, 99, 116, 45, 110, 97, 109, 101, 115, 5, 6, 111, 98, 106, 101, 99, 116, 6, 4, 0, 25, 114, 101, 103, 105, 115, 116, 101, 114, 45, 114, 101, 115, 111, 117, 114, 99, 101, 45, 114, 101, 113, 117, 101, 115, 116, 3, 0, 7, 1, 64, 1, 7, 114, 101, 113, 117, 101, 115, 116, 8, 1, 0, 4, 0, 8, 114, 101, 103, 105, 115, 116, 101, 114, 1, 9, 3, 1, 46, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 114, 101, 103, 105, 115, 116, 101, 114, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 2, 1, 66, 17, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 107, 121, 1, 104, 1, 1, 107, 3, 1, 113, 2, 7, 108, 105, 116, 101, 114, 97, 108, 1, 2, 0, 3, 114, 101, 115, 1, 4, 0, 4, 0, 10, 101, 105, 116, 104, 101, 114, 45, 117, 51, 50, 3, 0, 5, 1, 106, 1, 121, 1, 3, 1, 114, 2, 4, 110, 97, 109, 101, 115, 6, 108, 101, 110, 103, 116, 104, 7, 4, 0, 18, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 97, 114, 103, 115, 3, 0, 8, 1, 105, 1, 1, 114, 2, 3, 117, 114, 108, 10, 6, 114, 101, 115, 117, 108, 116, 10, 4, 0, 20, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 114, 101, 115, 117, 108, 116, 3, 0, 11, 1, 64, 1, 4, 97, 114, 103, 115, 9, 1, 0, 4, 0, 20, 99, 114, 101, 97, 116, 101, 45, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 1, 13, 1, 64, 0, 1, 0, 4, 0, 16, 104, 97, 110, 100, 108, 101, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 1, 14, 4, 1, 60, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 3, 4, 1, 50, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 64, 48, 46, 49, 46, 48, 4, 0, 11, 28, 1, 0, 22, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 3, 0, 0, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 50, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 56, 46, 48]; +pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 968] = [0, 97, 115, 109, 13, 0, 1, 0, 0, 25, 22, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 45, 101, 110, 99, 111, 100, 105, 110, 103, 4, 0, 7, 188, 6, 1, 65, 2, 1, 65, 7, 1, 66, 17, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 1, 1, 112, 125, 1, 105, 0, 1, 64, 1, 5, 118, 97, 108, 117, 101, 1, 0, 2, 4, 0, 19, 91, 99, 111, 110, 115, 116, 114, 117, 99, 116, 111, 114, 93, 111, 117, 116, 112, 117, 116, 1, 3, 1, 104, 0, 1, 64, 2, 4, 115, 101, 108, 102, 4, 13, 102, 117, 110, 99, 116, 105, 111, 110, 45, 110, 97, 109, 101, 115, 0, 2, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 109, 97, 112, 1, 5, 1, 107, 1, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 6, 4, 0, 18, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 103, 101, 116, 1, 7, 1, 64, 1, 4, 115, 101, 108, 102, 4, 0, 2, 4, 0, 24, 91, 109, 101, 116, 104, 111, 100, 93, 111, 117, 116, 112, 117, 116, 46, 100, 117, 112, 108, 105, 99, 97, 116, 101, 1, 8, 1, 111, 2, 115, 4, 1, 112, 9, 1, 64, 1, 6, 102, 105, 101, 108, 100, 115, 10, 0, 2, 4, 0, 13, 99, 114, 101, 97, 116, 101, 45, 115, 116, 114, 117, 99, 116, 1, 11, 3, 1, 44, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 111, 117, 116, 112, 117, 116, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 0, 2, 3, 0, 0, 6, 111, 117, 116, 112, 117, 116, 1, 66, 11, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 104, 1, 1, 114, 1, 6, 111, 98, 106, 101, 99, 116, 2, 4, 0, 12, 111, 98, 106, 101, 99, 116, 45, 102, 105, 101, 108, 100, 3, 0, 3, 1, 112, 115, 1, 112, 4, 1, 114, 4, 4, 116, 121, 112, 101, 115, 4, 110, 97, 109, 101, 115, 12, 111, 98, 106, 101, 99, 116, 45, 110, 97, 109, 101, 115, 5, 6, 111, 98, 106, 101, 99, 116, 6, 4, 0, 25, 114, 101, 103, 105, 115, 116, 101, 114, 45, 114, 101, 115, 111, 117, 114, 99, 101, 45, 114, 101, 113, 117, 101, 115, 116, 3, 0, 7, 1, 64, 1, 7, 114, 101, 113, 117, 101, 115, 116, 8, 1, 0, 4, 0, 8, 114, 101, 103, 105, 115, 116, 101, 114, 1, 9, 3, 1, 46, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 114, 101, 103, 105, 115, 116, 101, 114, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 2, 1, 66, 16, 2, 3, 2, 1, 1, 4, 0, 6, 111, 117, 116, 112, 117, 116, 3, 0, 0, 1, 107, 121, 1, 104, 1, 1, 107, 3, 1, 113, 2, 7, 108, 105, 116, 101, 114, 97, 108, 1, 2, 0, 3, 114, 101, 115, 1, 4, 0, 4, 0, 10, 101, 105, 116, 104, 101, 114, 45, 117, 51, 50, 3, 0, 5, 1, 114, 2, 4, 110, 97, 109, 101, 115, 6, 108, 101, 110, 103, 116, 104, 3, 4, 0, 18, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 97, 114, 103, 115, 3, 0, 7, 1, 105, 1, 1, 114, 2, 3, 117, 114, 108, 9, 6, 114, 101, 115, 117, 108, 116, 9, 4, 0, 20, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 45, 114, 101, 115, 117, 108, 116, 3, 0, 10, 1, 64, 1, 4, 97, 114, 103, 115, 8, 1, 0, 4, 0, 20, 99, 114, 101, 97, 116, 101, 45, 114, 97, 110, 100, 111, 109, 45, 115, 116, 114, 105, 110, 103, 1, 12, 1, 64, 0, 1, 0, 4, 0, 16, 104, 97, 110, 100, 108, 101, 45, 102, 117, 110, 99, 116, 105, 111, 110, 115, 1, 13, 4, 1, 60, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 45, 105, 110, 116, 101, 114, 102, 97, 99, 101, 64, 48, 46, 49, 46, 48, 5, 3, 4, 1, 50, 99, 111, 109, 112, 111, 110, 101, 110, 116, 58, 112, 117, 108, 117, 109, 105, 45, 119, 97, 115, 109, 47, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 64, 48, 46, 49, 46, 48, 4, 0, 11, 28, 1, 0, 22, 112, 117, 108, 117, 109, 105, 45, 112, 114, 111, 118, 105, 100, 101, 114, 45, 114, 97, 110, 100, 111, 109, 3, 0, 0, 0, 70, 9, 112, 114, 111, 100, 117, 99, 101, 114, 115, 1, 12, 112, 114, 111, 99, 101, 115, 115, 101, 100, 45, 98, 121, 2, 13, 119, 105, 116, 45, 99, 111, 109, 112, 111, 110, 101, 110, 116, 6, 48, 46, 50, 49, 46, 48, 16, 119, 105, 116, 45, 98, 105, 110, 100, 103, 101, 110, 45, 114, 117, 115, 116, 6, 48, 46, 49, 56, 46, 48]; #[inline(never)] #[doc(hidden)] diff --git a/pulumi_wasm_random/src/lib.rs b/pulumi_wasm_random/src/lib.rs index 6ca3814bb..201c41583 100644 --- a/pulumi_wasm_random/src/lib.rs +++ b/pulumi_wasm_random/src/lib.rs @@ -12,14 +12,14 @@ impl Guest for Component { fn create_random_string(args: RandomStringArgs) { let r#type = "random:index/randomString:RandomString".to_string(); - let handle; - let length = match args.length { - Ok(length) => { - handle = Output::new(rmp_serde::to_vec(&length).unwrap().as_slice()); - &handle - } - Err(output) => output, - }; + // let handle; + // let length = match args.length { + // Ok(length) => { + // handle = Output::new(rmp_serde::to_vec(&length).unwrap().as_slice()); + // &handle + // } + // Err(output) => output, + // }; // let object = vec![ // ObjectField { @@ -32,7 +32,7 @@ impl Guest for Component { type_: r#type, name: args.name, object_names: vec!["length".to_string()], - object: vec![ObjectField { object: length }], + object: vec![ObjectField { object: &args.length }], }; register(request); diff --git a/wits/world.wit b/wits/world.wit index 93f1c36ed..d27f2c6c4 100644 --- a/wits/world.wit +++ b/wits/world.wit @@ -75,7 +75,7 @@ interface pulumi-provider-random-interface { record random-string-args { name: string, - length: result>, + length: borrow, } record random-string-result {