pub struct File {
pub buffer: Vec<u8>,
pub path: String,
pub mode: Option<u32>,
pub is_dir: bool,
pub last_modified: Option<u64>,
}Expand description
Represents a file or directory entry in an archive
This structure holds all the metadata and content for a single entry in an archive file.
Fields§
§buffer: Vec<u8>The file content as raw bytes
path: StringThe relative path of the file within the archive
mode: Option<u32>Unix file permissions (e.g., 0o755 for rwxr-xr-x)
is_dir: boolWhether this entry represents a directory
last_modified: Option<u64>Last modification time as Unix timestamp (seconds since epoch)
Implementations§
Source§impl File
impl File
Sourcepub fn new(
path: String,
buffer: Vec<u8>,
mode: Option<u32>,
is_dir: bool,
last_modified: Option<u64>,
) -> Self
pub fn new( path: String, buffer: Vec<u8>, mode: Option<u32>, is_dir: bool, last_modified: Option<u64>, ) -> Self
Create a new File entry
§Arguments
path- The relative path within the archivebuffer- The file contentmode- Optional Unix permissionsis_dir- Whether this is a directorylast_modified- Optional modification timestamp
Trait Implementations§
Auto Trait Implementations§
impl Freeze for File
impl RefUnwindSafe for File
impl Send for File
impl Sync for File
impl Unpin for File
impl UnsafeUnpin for File
impl UnwindSafe for File
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