我正试图在我的铁 rust 紫杉应用程序中读取一个名为Book.txt的文件.我正在使用Trunk的copy-file
为Book.txt提供服务,以便可以从http://localhost:8080/Book.txt.访问它
try 使用std::FS读取文件不起作用(出现错误Could not open file: Error { kind: Unsupported, message: "operation not supported on this platform" }
),但我想知道是否有其他方法可以读取此文件.
我也试图使用wasm32-unknown-emscripten
的目标,但似乎没有任何作用.如果可能的话,我真的希望避免使用客户端-服务器体系 struct ,即我将文件放在服务器上并在那里读取,因为我希望最终将所有这些都托管在GitHub页面上.
非常感谢您的帮助.
谢谢!