pub enum InodeWrapper {
V5(RafsV5Inode),
V6(RafsV6Inode),
Ref(Arc<dyn RafsInodeExt>),
}Expand description
An inode object wrapper for different RAFS versions.
Variants§
V5(RafsV5Inode)
Inode info structure for RAFS v5.
V6(RafsV6Inode)
Inode info structure for RAFS v6, reuse RafsV5Inode as IR for v6.
Ref(Arc<dyn RafsInodeExt>)
A reference to a RafsInodeExt object.
Implementations§
Source§impl InodeWrapper
impl InodeWrapper
Sourcepub fn new(version: RafsVersion) -> Self
pub fn new(version: RafsVersion) -> Self
Create a new instance of InodeWrapper with default value.
Sourcepub fn from_inode_info(inode: Arc<dyn RafsInodeExt>) -> Self
pub fn from_inode_info(inode: Arc<dyn RafsInodeExt>) -> Self
Create an InodeWrapper object from a RafsInodeExt trait object.
Sourcepub fn inode_size(&self) -> usize
pub fn inode_size(&self) -> usize
Get file content size of the inode.
Sourcepub fn is_hardlink(&self) -> bool
pub fn is_hardlink(&self) -> bool
Check whether the inode is a hardlink.
Sourcepub fn is_symlink(&self) -> bool
pub fn is_symlink(&self) -> bool
Check whether the inode is a symlink.
Sourcepub fn is_special(&self) -> bool
pub fn is_special(&self) -> bool
Check whether the inode is a special file, such chardev, blkdev, FIFO and socket.
Sourcepub fn has_hardlink(&self) -> bool
pub fn has_hardlink(&self) -> bool
Get inode flags.
Sourcepub fn set_has_hardlink(&mut self, enable: bool)
pub fn set_has_hardlink(&mut self, enable: bool)
Set whether the inode has HARDLINK flag set.
Sourcepub fn set_has_xattr(&mut self, enable: bool)
pub fn set_has_xattr(&mut self, enable: bool)
Set whether the inode has associated xattrs.
Sourcepub fn set_parent(&mut self, parent: Inode)
pub fn set_parent(&mut self, parent: Inode)
Set parent inode number, only for RAFS v5.
Sourcepub fn mtime_nsec(&self) -> u32
pub fn mtime_nsec(&self) -> u32
Get nsec part of modified time.
Sourcepub fn set_mtime_nsec(&mut self, mtime_nsec: u32)
pub fn set_mtime_nsec(&mut self, mtime_nsec: u32)
Set nsec part of modified time.
Sourcepub fn set_blocks(&mut self, blocks: u64)
pub fn set_blocks(&mut self, blocks: u64)
Set data blocks of file content, in unit of 512 bytes.
Sourcepub fn set_projid(&mut self, projid: u32)
pub fn set_projid(&mut self, projid: u32)
Set project ID associated with the inode.
Sourcepub fn digest(&self) -> &RafsDigest
pub fn digest(&self) -> &RafsDigest
Get digest of inode metadata, RAFS v5 only.
Sourcepub fn set_digest(&mut self, digest: RafsDigest)
pub fn set_digest(&mut self, digest: RafsDigest)
Set digest of inode metadata, RAFS v5 only.
Sourcepub fn set_name_size(&mut self, size: usize)
pub fn set_name_size(&mut self, size: usize)
Set size of inode name.
Sourcepub fn symlink_size(&self) -> u16
pub fn symlink_size(&self) -> u16
Get size of symlink.
Sourcepub fn set_symlink_size(&mut self, size: usize)
pub fn set_symlink_size(&mut self, size: usize)
Set size of symlink.
Sourcepub fn child_index(&self) -> u32
pub fn child_index(&self) -> u32
Get child inode index, only valid for RAFS v5.
Sourcepub fn set_child_index(&mut self, index: u32)
pub fn set_child_index(&mut self, index: u32)
Set child inode index, only fro RAFS v5.
Sourcepub fn child_count(&self) -> u32
pub fn child_count(&self) -> u32
Get child/chunk count.
Sourcepub fn set_child_count(&mut self, count: u32)
pub fn set_child_count(&mut self, count: u32)
Set child/chunk count.
Sourcepub fn create_chunk(&self) -> ChunkWrapper
pub fn create_chunk(&self) -> ChunkWrapper
Create a ChunkWrapper object to be associated with the inode.
Sourcepub fn get_inode_size_with_xattr(
&self,
xattrs: &RafsXAttrs,
v6_compact: bool,
) -> usize
pub fn get_inode_size_with_xattr( &self, xattrs: &RafsXAttrs, v6_compact: bool, ) -> usize
Get memory/disk space occupied by the inode structure, including xattrs.
Trait Implementations§
Source§impl Clone for InodeWrapper
impl Clone for InodeWrapper
Source§fn clone(&self) -> InodeWrapper
fn clone(&self) -> InodeWrapper
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more