潘泳权wpac-应用waPC (rust) 做软件测试工具.pptx

编号:132092 PPTX 30页 2.50MB 下载积分:VIP专享
下载报告请您先登录!

潘泳权wpac-应用waPC (rust) 做软件测试工具.pptx

1、第三届中国第三届中国Rust开发者大会开发者大会应用应用waPC(rust)做软件测试工具做软件测试工具Alan poon 潘泳权大家好!rustropy_gamingruito_89PhoTto/image/chartWebassembly Procedures CallwaPC 协议标准化了本机代码调用 WebAssembly 和 WebAssembly 调用本机代码的通信通信(messaging)和错误错误处理处理(error handling)。什么是waPC?WASM外部函数接口 FFIInput type Return typePlatform底层底层I32I32Unknownwa

2、PC&u8ResultVec,errorLinux x86_64,macOS x86_64,Windows x86_64,cargo build target wasm-unknown-unknownwaPC Host(Go)waPC Guest RustRead wasm fileSelect engineWazeroWasmer-goWasmertime-goDefine hostcall capabilityInstantiateInvoke-command with dataGuest 指wasmOperation是我们要在wasm里注册命名以数据的长度,设置wasm 的linear

3、memory 的指针Guest可执行任务Guest也可返回请求hostInvoke(ctx,operation,payload)WAPC 流程Uses Length of response and error to return resultres,err:=InvokeWAPC 流程#no_manglepub fn wapc_init()wapc:register_function(ping,ping);fn ping(msg:&u8)-wapc:CallResult.Ok(msg.to_vec()waPC Guest RustwaPCUse wapc_init to register fu

4、nctionRegister_function can only be used inside WAPC_initRegister_function cannot be called inside ping_start is meant to support tinygos wasmwaPC host will still run both wapc_init and _start during intializationwaPC Guest RustwaPC Use wapc_init to register function _start also canUtil Lib uses wap

5、c_init,users build on top of”_start”extern crate wapc_guest as guest;extern crate Regex;.fn echo_req_json(msg:&u8)-CallResult let mut req=foo_unmarshall:(msg)?;let re=Regex:new(r”/v2/matches/(a-zA-Z0-9_-+)/info).unwrap();if let Some(cap)=re.captures(&req.HttpPath)req.HttpProxyUrl=String:from(“localh

6、ost:8000);req.HttpScheme=String:from(http);let request=serde_json:to_string(&req)?;Ok(request.as_bytes().to_vec()fn do_nothing(msg:&u8)-CallResult Ok(msg.to_vec()#no_manglepub extern C fn _start()let mut reg=REGISTRY.lock().unwrap();reg.insert(“/v2/matches/.*/info_modify_req”.into(),echo_req_json);r

友情提示

1、下载报告失败解决办法
2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
4、本站报告下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。

本文(潘泳权wpac-应用waPC (rust) 做软件测试工具.pptx)为本站 (2200) 主动上传,三个皮匠报告文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知三个皮匠报告文库(点击联系客服),我们立即给予删除!

温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。
客服
商务合作
小程序
服务号
折叠