node_sys/class/fs/
dirent.rs

1use js_sys::{JsString, Object};
2use wasm_bindgen::prelude::*;
3
4#[wasm_bindgen(module = "fs")]
5extern {
6    #[wasm_bindgen(extends = Object)]
7    #[derive(Clone, Debug)]
8    pub type Dirent;
9
10    // FIXME: event overloads
11
12    //******************//
13    // Instance Methods //
14    //******************//
15
16    #[wasm_bindgen(method, js_name = "isFile")]
17    pub fn is_file(this: &Dirent) -> bool;
18
19    #[wasm_bindgen(method, js_name = "isDirectory")]
20    pub fn is_directory(this: &Dirent) -> bool;
21
22    #[wasm_bindgen(method, js_name = "isBlockDevice")]
23    pub fn is_block_device(this: &Dirent) -> bool;
24
25    #[wasm_bindgen(method, js_name = "isCharacterDevice")]
26    pub fn is_character_device(this: &Dirent) -> bool;
27
28    #[wasm_bindgen(method, js_name = "isSymbolic")]
29    pub fn is_symbolic_link(this: &Dirent) -> bool;
30
31    #[wasm_bindgen(method, js_name = "isFIFO")]
32    pub fn is_fifo(this: &Dirent) -> bool;
33
34    #[wasm_bindgen(method, js_name = "isSocket")]
35    pub fn is_socket(this: &Dirent) -> bool;
36
37    //*********************//
38    // Instance Properties //
39    //*********************//
40
41    #[wasm_bindgen(method, getter)]
42    pub fn name(this: &Dirent) -> JsString;
43}