Skip to main content

FileTypeExt

Trait FileTypeExt 

Source
pub trait FileTypeExt {
    // Required methods
    fn is_block_device(&self) -> bool;
    fn is_char_device(&self) -> bool;
    fn is_socket(&self) -> bool;
}
🔬This is a nightly-only experimental API. (wasi_ext #71213)
Available on WASI only.
Expand description

WASI-specific extensions for fs::FileType.

Adds support for special WASI file types such as block/character devices, pipes, and sockets.

Required Methods§

Source

fn is_block_device(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).

Returns true if this file type is a block device.

Source

fn is_char_device(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).

Returns true if this file type is a character device.

Source

fn is_socket(&self) -> bool

🔬This is a nightly-only experimental API. (wasi_ext #71213)
This item is validated for IEC 61508 (SIL 2) and ISO 26262 (ASIL B).

Returns true if this file type is any type of socket.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§