我有一个lib包含大量结构和实现的板条箱。然后我还有另一个叫做web它将核心移植lib到网络上的工具。还有一种api情况是我希望应用程序位于服务器端。
myproject-apimyproject-libmyproject-web我不想要的是将所有wasm依赖项添加到lib, 仅在web项目中并将主库的部分内容公开到网络。in#[wasm_bindgen]中定义的结构是否可能?myproject-libmyproject-web
我访问该网站并看到一个下载 Rust 安装程序的脚本:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Run Code Online (Sandbox Code Playgroud)
我更改了选项中的一些内容Customize Installation并继续安装,然后出现以下错误:
info: profile set to 'complete'
info: setting default host triple to x86_64-unknown-linux-gnu
info: syncing channel updates for 'nightly-x86_64-unknown-linux-gnu'
info: latest update on 2020-05-04, rust version 1.45.0-nightly (65b448273 2020-05-03)
warning: Force-skipping unavailable component 'lldb-preview-x86_64-unknown-linux-gnu'
warning: Force-skipping unavailable component 'rls-x86_64-unknown-linux-gnu'
info: downloading component 'cargo'
5.0 MiB / 5.0 MiB (100 %) 3.2 MiB/s in 2s ETA: 0s
info: downloading component 'clippy'
info: downloading component 'llvm-tools-preview'
info: downloading …Run Code Online (Sandbox Code Playgroud) 我想制作一个自定义小部件,它基本上通过获取一个文本,将它包装在一个包含两个文本的堆栈中,其中一个用一个笔触呈现来为文本添加一个笔触。
class BorderedText extends StatelessWidget {
final Text displayText;
final Color strokeColor;
final double strokeWidth;
BorderedText(this.displayText,
{Key key, this.strokeColor = Colors.black, this.strokeWidth = 1.0})
: assert(displayText != null),
super(key: key);
@override
Widget build(BuildContext context) {
return Container(
child: Stack(
children: <Widget>[
Text(
displayText.data,
style: displayText.style
..foreground = Paint()
..style = PaintingStyle.stroke
..strokeWidth = strokeWidth
..color = strokeColor,
),
displayText,
],
),
);
}
}
Run Code Online (Sandbox Code Playgroud)
预期使用方式:
BorderedText(
Text(
"Hello App",
style: TextStyle(
color: Colors.white,
fontSize: 34.0,
fontFamily: "LexendMega",
),
),
strokeWidth: …Run Code Online (Sandbox Code Playgroud)