nebkad

nebkad

请阻止我发帖
V2EX 第 557390 号会员,加入于 2021-09-30 23:34:06 +08:00
今日活跃度排名 21259
根据 nebkad 的设置,主题列表只有在你登录之后才可查看
二手交易 相关的信息,包括已关闭的交易,不会被隐藏
nebkad 最近回复了
24 天前
回复了 bli22ard 创建的主题 Rust rust 的 File 是有魔法吗?
@bli22ard #7

std 的源码是公开的,你甚至都不用下载直接在我发给你的链接开始点两下就看到了。
就算你改成了支持 &mut 语义,如果 OS 不支持独占,难道你还能阻止别的调用者用同样的路径再开一个 File 吗?
25 天前
回复了 bli22ard 创建的主题 Rust rust 的 File 是有魔法吗?
@bli22ard 如果你对 std 的设计不是很满意,你的 OS 平台支持你在 Rust 中使用 &mut 语义的话,你自己重新包装一个 File 也不是很难啊
25 天前
回复了 bli22ard 创建的主题 Rust rust 的 File 是有魔法吗?
@bli22ard #2

https://doc.rust-lang.org/stable/std/fs/struct.File.html

Note that, although read and write methods require a &mut File, because of the interfaces for Read and Write, the holder of a &File can still modify the file, either through methods that take &File or by retrieving the underlying OS object and modifying the file that way. Additionally, many operating systems allow concurrent modification of files by different processes. Avoid assuming that holding a &File means that the file will not change.
请问这个引擎适合哪些类型的游戏后端?
是否可以举例说明?或者说市面上哪款游戏的后端可以用这个引擎帮助或参与实现?
根据你的描述,如果该字段每次都输出不一样的值,
我能想到的一种影响就是会影响 hash 的结果,
有可能会在 Rust 以为是不可变引用的情况下造成 bug
77 天前
回复了 nebkad 创建的主题 Rust 如果 Pin 有语法糖
@kkocdko
用到 Pin 的情况不多,会不会有可能是因为用 Pin 要多打字母并且没有语法糖呢?
因为大部分用 `&mut X` 的其实都可以更严格(也更安全地)用 `Pin<&mut X>` 也不会造成什么多打字母以外的实际困难
78 天前
回复了 nebkad 创建的主题 Rust 如果 Pin 有语法糖
话说,有没有人有兴趣发明创造一个 rust 的方言
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5402 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 14ms · UTC 08:19 · PVG 16:19 · LAX 01:19 · JFK 04:19
Developed with CodeLauncher
♥ Do have faith in what you're doing.