Trait std::os::wasi::fs::FileTypeExt

source ·
pub trait FileTypeExt {
    // Required methods
    fn is_block_device(&self) -> bool;
    fn is_char_device(&self) -> bool;
    fn is_socket_dgram(&self) -> bool;
    fn is_socket_stream(&self) -> bool;

    // Provided method
    fn is_socket(&self) -> bool { ... }
}
🔬This is a nightly-only experimental API. (wasi_ext #71213)
Available on WASI only.
Expand description

特定于 WASI 的 fs::FileType 的扩展。

增加了对特殊 WASI 文件类型的支持,例如 block/character 设备,管道和套接字。

Required Methods§

source

fn is_block_device(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)

如果此文件类型是块设备,则返回 true

source

fn is_char_device(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)

如果此文件类型是字符设备,则返回 true

source

fn is_socket_dgram(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)

如果此文件类型是套接字数据报,则返回 true

source

fn is_socket_stream(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)

如果此文件类型是套接字流,则返回 true

Provided Methods§

source

fn is_socket(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)

如果此文件类型是任何类型的套接字,则返回 true

Implementors§