通常在 Rust 应用程序中,我会使用 获得系统时间std::time::SystemTime::now(),但这在 yew 应用程序中似乎不起作用。相反,我试图以静默方式(从服务器日志)读取系统时间的组件失败,并且在 Web 控制台中我得到panicked at 'time not implemented on this platform'.
std::time::SystemTime::now()
panicked at 'time not implemented on this platform'
这是有道理的,出于安全原因,客户端应用程序不能随意从操作系统中获取系统时间。但是 yew 是否提供了一种从浏览器获取此信息的方法?
rust yew
rust ×1
yew ×1