pub struct Inode {
pub id: InodeId,
pub file_type: FileType,
pub size: u64,
pub blocks: Vec<BlockId>,
pub permissions: Permissions,
pub created_us: u64,
pub modified_us: u64,
pub accessed_us: u64,
pub nlink: u32,
pub symlink_target: Option<String>,
pub soch_schema: Option<String>,
}Expand description
Inode structure (file/directory metadata)
Fields§
§id: InodeIdUnique inode number
file_type: FileTypeFile type
size: u64File size in bytes
blocks: Vec<BlockId>Data blocks (for regular files)
permissions: PermissionsPermissions
created_us: u64Creation time (microseconds since epoch)
modified_us: u64Modification time (microseconds since epoch)
accessed_us: u64Access time (microseconds since epoch)
nlink: u32Number of hard links
symlink_target: Option<String>For symlinks: target path
soch_schema: Option<String>For TOON documents: schema name
Implementations§
Source§impl Inode
impl Inode
pub fn new_file(id: InodeId) -> Self
pub fn new_directory(id: InodeId) -> Self
pub fn new_symlink(id: InodeId, target: String) -> Self
pub fn new_toon(id: InodeId, schema: String) -> Self
pub fn is_dir(&self) -> bool
pub fn is_file(&self) -> bool
pub fn is_symlink(&self) -> bool
pub fn is_toon(&self) -> bool
pub fn touch(&mut self)
pub fn update_access_time(&mut self)
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self, String>
pub fn from_bytes(data: &[u8]) -> Result<Self, String>
Deserialize inode from bytes
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Inode
impl<'de> Deserialize<'de> for Inode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Inode
impl RefUnwindSafe for Inode
impl Send for Inode
impl Sync for Inode
impl Unpin for Inode
impl UnwindSafe for Inode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more