1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#![allow(unused_imports)]
pub(super) use core::cmp::min;
pub(super) use core::marker::PhantomData;
pub(super) use core::mem::size_of;
pub(super) use core::time::Duration;
pub(super) use core::{cmp, fmt, mem, num, ptr, slice};
#[cfg(feature = "std")]
pub(super) use std::ffi::{CStr, CString};
#[cfg(feature = "std")]
pub(super) use std::{io, time};
pub(super) use crate::error::{Error, ErrorCode};
pub(super) use crate::internal::fuse_io;
pub(super) use crate::internal::fuse_kernel;
pub(super) use crate::protocol::common::{
DebugBytesAsString,
DebugClosure,
DebugHexU32,
FileMode,
FileType,
Node,
NodeAttr,
NodeId,
NodeName,
XattrError,
XattrName,
};
pub(super) use crate::internal::fuse_io::{
DecodeRequest,
EncodeResponse,
RequestDecoder,
ResponseEncoder,
};
pub(crate) fn try_node_id(raw: u64) -> Result<NodeId, Error> {
match NodeId::new(raw) {
Some(x) => Ok(x),
None => Err(Error::missing_node_id()),
}
}