parent
3d2e3a59d1
commit
99e740eb97
@ -0,0 +1,22 @@
|
|||||||
|
//! Datatypes for the program
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
/// A raw file or directory inode number
|
||||||
|
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Copy)]
|
||||||
|
#[repr(transparent)]
|
||||||
|
pub struct INode(u64);
|
||||||
|
|
||||||
|
impl INode
|
||||||
|
{
|
||||||
|
/// Create a new `INode` wrapper from any `u64` without checking if it is a real inode.
|
||||||
|
#[inline] pub const unsafe fn new_unchecked(ino: u64) -> Self
|
||||||
|
{
|
||||||
|
Self(ino)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Convert into raw `u64` inode number.
|
||||||
|
#[inline] pub const fn into_inner(self) -> u64
|
||||||
|
{
|
||||||
|
self.0
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue