-
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.
Support optional result fields (#96)
- Loading branch information
1 parent
3bb86bc
commit fa39f3e
Showing
23 changed files
with
503 additions
and
434 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
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
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 |
---|---|---|
|
@@ -187,7 +187,7 @@ pub mod component { | |
} | ||
impl Output { | ||
#[allow(unused_unsafe, clippy::all)] | ||
pub fn get_field(&self, field: &str) -> Output { | ||
pub fn get_field(&self, field: &str, required: bool) -> Output { | ||
unsafe { | ||
let vec0 = field; | ||
let ptr0 = vec0.as_ptr().cast::<u8>(); | ||
|
@@ -197,14 +197,22 @@ pub mod component { | |
#[link(wasm_import_module = "component:pulumi-wasm/[email protected]")] | ||
extern "C" { | ||
#[link_name = "[method]output.get-field"] | ||
fn wit_import(_: i32, _: *mut u8, _: usize) -> i32; | ||
fn wit_import(_: i32, _: *mut u8, _: usize, _: i32) -> i32; | ||
} | ||
|
||
#[cfg(not(target_arch = "wasm32"))] | ||
fn wit_import(_: i32, _: *mut u8, _: usize) -> i32 { | ||
fn wit_import(_: i32, _: *mut u8, _: usize, _: i32) -> i32 { | ||
unreachable!() | ||
} | ||
let ret = wit_import((self).handle() as i32, ptr0.cast_mut(), len0); | ||
let ret = wit_import( | ||
(self).handle() as i32, | ||
ptr0.cast_mut(), | ||
len0, | ||
match &required { | ||
true => 1, | ||
false => 0, | ||
}, | ||
); | ||
Output::from_handle(ret as u32) | ||
} | ||
} | ||
|
@@ -1615,66 +1623,66 @@ pub(crate) use __export_main_world_impl as export; | |
#[cfg(target_arch = "wasm32")] | ||
#[link_section = "component-type:wit-bindgen:0.21.0:main-world:encoded world"] | ||
#[doc(hidden)] | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2581] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x94\x13\x01A\x02\x01\ | ||
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 2591] = *b"\ | ||
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9e\x13\x01A\x02\x01\ | ||
A\x15\x01B\x15\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@\x02\x04self\x04\x05fields\0\x02\x04\0\x18[\ | ||
method]output.get-field\x01\x08\x01@\x01\x04self\x04\0s\x04\0\x17[method]output.\ | ||
get-type\x01\x09\x01@\x01\x04self\x04\0\x02\x04\0\x18[method]output.duplicate\x01\ | ||
\x0a\x01@\0\0s\x04\0\x10describe-outputs\x01\x0b\x01@\0\0\x7f\x04\0\x0fnon-done-\ | ||
exists\x01\x0c\x03\x01,component:pulumi-wasm/[email protected].0\x05\0\x02\x03\ | ||
\0\0\x06output\x01B\x0b\x02\x03\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01\ | ||
r\x02\x04names\x05value\x02\x04\0\x0cobject-field\x03\0\x03\x01p\x04\x01r\x03\x04\ | ||
types\x04names\x06object\x05\x04\0\x19register-resource-request\x03\0\x06\x01i\x01\ | ||
\x01@\x01\x07request\x07\0\x08\x04\0\x08register\x01\x09\x03\x01.component:pulum\ | ||
i-wasm/[email protected]\x05\x02\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06ou\ | ||
tput\x03\0\0\x01h\x01\x01r\x02\x07keepers\x02\x06length\x02\x04\0\x04args\x03\0\x03\ | ||
\x01i\x01\x01r\x04\x06base64\x05\x03hex\x05\x07keepers\x05\x06length\x05\x04\0\x03\ | ||
res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01\ | ||
!pulumi:random/[email protected]\x05\x03\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06\ | ||
output\x03\0\0\x01h\x01\x01r\x03\x0bbyte-length\x02\x07keepers\x02\x06prefix\x02\ | ||
\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x07\x07b64-std\x05\x07b64-url\x05\x0bbyte\ | ||
-length\x05\x03dec\x05\x03hex\x05\x07keepers\x05\x06prefix\x05\x04\0\x03res\x03\0\ | ||
\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01\x1epulu\ | ||
mi:random/[email protected]\x05\x04\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\ | ||
\0\0\x01h\x01\x01r\x04\x07keepers\x02\x03max\x02\x03min\x02\x04seed\x02\x04\0\x04\ | ||
args\x03\0\x03\x01i\x01\x01r\x05\x07keepers\x05\x03max\x05\x03min\x05\x06result\x05\ | ||
\x04seed\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06\ | ||
invoke\x01\x08\x04\x01#pulumi:random/[email protected]\x05\x05\x01B\x0a\x02\x03\ | ||
\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x0c\x07keepers\x02\x06length\x02\ | ||
\x05lower\x02\x09min-lower\x02\x0bmin-numeric\x02\x0bmin-special\x02\x09min-uppe\ | ||
r\x02\x06number\x02\x07numeric\x02\x10override-special\x02\x07special\x02\x05upp\ | ||
er\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x0e\x0bbcrypt-hash\x05\x07keepers\x05\ | ||
\x06length\x05\x05lower\x05\x09min-lower\x05\x0bmin-numeric\x05\x0bmin-special\x05\ | ||
\x09min-upper\x05\x06number\x05\x07numeric\x05\x10override-special\x05\x06result\ | ||
\x05\x07special\x05\x05upper\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04arg\ | ||
s\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01$pulumi:random/[email protected]\ | ||
\x05\x06\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x04\x07\ | ||
keepers\x02\x06length\x02\x06prefix\x02\x09separator\x02\x04\0\x04args\x03\0\x03\ | ||
\x01i\x01\x01r\x04\x07keepers\x05\x06length\x05\x06prefix\x05\x09separator\x05\x04\ | ||
\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\ | ||
\x01\x1fpulumi:random/[email protected]\x05\x07\x01B\x0a\x02\x03\x02\x01\x01\x04\ | ||
\0\x06output\x03\0\0\x01h\x01\x01r\x04\x06inputs\x02\x07keepers\x02\x0cresult-co\ | ||
unt\x02\x04seed\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x05\x06inputs\x05\x07k\ | ||
eepers\x05\x0cresult-count\x05\x07results\x05\x04seed\x05\x04\0\x03res\x03\0\x06\ | ||
\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01#pulumi:rand\ | ||
om/[email protected]\x05\x08\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\ | ||
\0\0\x01h\x01\x01r\x0c\x07keepers\x02\x06length\x02\x05lower\x02\x09min-lower\x02\ | ||
\x0bmin-numeric\x02\x0bmin-special\x02\x09min-upper\x02\x06number\x02\x07numeric\ | ||
\x02\x10override-special\x02\x07special\x02\x05upper\x02\x04\0\x04args\x03\0\x03\ | ||
\x01i\x01\x01r\x0d\x07keepers\x05\x06length\x05\x05lower\x05\x09min-lower\x05\x0b\ | ||
min-numeric\x05\x0bmin-special\x05\x09min-upper\x05\x06number\x05\x07numeric\x05\ | ||
\x10override-special\x05\x06result\x05\x07special\x05\x05upper\x05\x04\0\x03res\x03\ | ||
\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01\"pulu\ | ||
mi:random/[email protected]\x05\x09\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06out\ | ||
put\x03\0\0\x01h\x01\x01r\x01\x07keepers\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01\ | ||
r\x02\x07keepers\x05\x06result\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04a\ | ||
rgs\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01\x20pulumi:random/[email protected].\ | ||
0\x05\x0a\x04\x01\x1fpulumi:random/[email protected]\x04\0\x0b\x10\x01\0\x0amain\ | ||
-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201\ | ||
.0\x10wit-bindgen-rust\x060.21.0"; | ||
\0\x12[method]output.get\x01\x07\x01@\x03\x04self\x04\x05fields\x08required\x7f\0\ | ||
\x02\x04\0\x18[method]output.get-field\x01\x08\x01@\x01\x04self\x04\0s\x04\0\x17\ | ||
[method]output.get-type\x01\x09\x01@\x01\x04self\x04\0\x02\x04\0\x18[method]outp\ | ||
ut.duplicate\x01\x0a\x01@\0\0s\x04\0\x10describe-outputs\x01\x0b\x01@\0\0\x7f\x04\ | ||
\0\x0fnon-done-exists\x01\x0c\x03\x01,component:pulumi-wasm/[email protected]\ | ||
.0\x05\0\x02\x03\0\0\x06output\x01B\x0b\x02\x03\x02\x01\x01\x04\0\x06output\x03\0\ | ||
\0\x01h\x01\x01r\x02\x04names\x05value\x02\x04\0\x0cobject-field\x03\0\x03\x01p\x04\ | ||
\x01r\x03\x04types\x04names\x06object\x05\x04\0\x19register-resource-request\x03\ | ||
\0\x06\x01i\x01\x01@\x01\x07request\x07\0\x08\x04\0\x08register\x01\x09\x03\x01.\ | ||
component:pulumi-wasm/[email protected]\x05\x02\x01B\x0a\x02\x03\x02\x01\x01\ | ||
\x04\0\x06output\x03\0\0\x01h\x01\x01r\x02\x07keepers\x02\x06length\x02\x04\0\x04\ | ||
args\x03\0\x03\x01i\x01\x01r\x04\x06base64\x05\x03hex\x05\x07keepers\x05\x06leng\ | ||
th\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invok\ | ||
e\x01\x08\x04\x01!pulumi:random/[email protected]\x05\x03\x01B\x0a\x02\x03\x02\ | ||
\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x03\x0bbyte-length\x02\x07keepers\ | ||
\x02\x06prefix\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x07\x07b64-std\x05\x07b\ | ||
64-url\x05\x0bbyte-length\x05\x03dec\x05\x03hex\x05\x07keepers\x05\x06prefix\x05\ | ||
\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\ | ||
\x04\x01\x1epulumi:random/[email protected]\x05\x04\x01B\x0a\x02\x03\x02\x01\x01\x04\ | ||
\0\x06output\x03\0\0\x01h\x01\x01r\x04\x07keepers\x02\x03max\x02\x03min\x02\x04s\ | ||
eed\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x05\x07keepers\x05\x03max\x05\x03m\ | ||
in\x05\x06result\x05\x04seed\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04arg\ | ||
s\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01#pulumi:random/[email protected]\x05\ | ||
\x05\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x0c\x07k\ | ||
eepers\x02\x06length\x02\x05lower\x02\x09min-lower\x02\x0bmin-numeric\x02\x0bmin\ | ||
-special\x02\x09min-upper\x02\x06number\x02\x07numeric\x02\x10override-special\x02\ | ||
\x07special\x02\x05upper\x02\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x0e\x0bbcrypt\ | ||
-hash\x05\x07keepers\x05\x06length\x05\x05lower\x05\x09min-lower\x05\x0bmin-nume\ | ||
ric\x05\x0bmin-special\x05\x09min-upper\x05\x06number\x05\x07numeric\x05\x10over\ | ||
ride-special\x05\x06result\x05\x07special\x05\x05upper\x05\x04\0\x03res\x03\0\x06\ | ||
\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01$pulumi:rand\ | ||
om/[email protected]\x05\x06\x01B\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\ | ||
\0\0\x01h\x01\x01r\x04\x07keepers\x02\x06length\x02\x06prefix\x02\x09separator\x02\ | ||
\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x04\x07keepers\x05\x06length\x05\x06prefi\ | ||
x\x05\x09separator\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\ | ||
\x04\0\x06invoke\x01\x08\x04\x01\x1fpulumi:random/[email protected]\x05\x07\x01B\ | ||
\x0a\x02\x03\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x04\x06inputs\x02\ | ||
\x07keepers\x02\x0cresult-count\x02\x04seed\x02\x04\0\x04args\x03\0\x03\x01i\x01\ | ||
\x01r\x05\x06inputs\x05\x07keepers\x05\x0cresult-count\x05\x07results\x05\x04see\ | ||
d\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\ | ||
\x01\x08\x04\x01#pulumi:random/[email protected]\x05\x08\x01B\x0a\x02\x03\x02\ | ||
\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x0c\x07keepers\x02\x06length\x02\x05\ | ||
lower\x02\x09min-lower\x02\x0bmin-numeric\x02\x0bmin-special\x02\x09min-upper\x02\ | ||
\x06number\x02\x07numeric\x02\x10override-special\x02\x07special\x02\x05upper\x02\ | ||
\x04\0\x04args\x03\0\x03\x01i\x01\x01r\x0d\x07keepers\x05\x06length\x05\x05lower\ | ||
\x05\x09min-lower\x05\x0bmin-numeric\x05\x0bmin-special\x05\x09min-upper\x05\x06\ | ||
number\x05\x07numeric\x05\x10override-special\x05\x06result\x05\x07special\x05\x05\ | ||
upper\x05\x04\0\x03res\x03\0\x06\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06in\ | ||
voke\x01\x08\x04\x01\"pulumi:random/[email protected]\x05\x09\x01B\x0a\x02\x03\ | ||
\x02\x01\x01\x04\0\x06output\x03\0\0\x01h\x01\x01r\x01\x07keepers\x02\x04\0\x04a\ | ||
rgs\x03\0\x03\x01i\x01\x01r\x02\x07keepers\x05\x06result\x05\x04\0\x03res\x03\0\x06\ | ||
\x01@\x02\x04names\x04args\x04\0\x07\x04\0\x06invoke\x01\x08\x04\x01\x20pulumi:r\ | ||
andom/[email protected].0\x05\x0a\x04\x01\x1fpulumi:random/[email protected]\x04\0\ | ||
\x0b\x10\x01\0\x0amain-world\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0d\ | ||
wit-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; | ||
|
||
#[inline(never)] | ||
#[doc(hidden)] | ||
|
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
Oops, something went wrong.