pub struct SitArchive {
pub entries: Vec<SitEntry>,
}Expand description
A StuffIt archive containing multiple entries.
Archives can be parsed from existing .sit files or created from scratch.
Fields§
§entries: Vec<SitEntry>The entries (files and folders) in this archive.
Implementations§
Source§impl SitArchive
impl SitArchive
Sourcepub fn serialize(&self) -> Result<Vec<u8>, SitError>
pub fn serialize(&self) -> Result<Vec<u8>, SitError>
Serialize the archive to bytes in StuffIt 5.0 format (uncompressed).
Sourcepub fn serialize_compressed(&self) -> Result<Vec<u8>, SitError>
pub fn serialize_compressed(&self) -> Result<Vec<u8>, SitError>
Serialize the archive to bytes in StuffIt 5.0 format with method 13 compression.
Sourcepub fn serialize_with_method(&self, method: u8) -> Result<Vec<u8>, SitError>
pub fn serialize_with_method(&self, method: u8) -> Result<Vec<u8>, SitError>
Serialize the archive to bytes in StuffIt 5.0 format with the specified compression method.
Sourcepub fn parse_segmented<P: AsRef<Path>>(paths: &[P]) -> Result<Self, SitError>
pub fn parse_segmented<P: AsRef<Path>>(paths: &[P]) -> Result<Self, SitError>
Parse a segmented StuffIt archive from multiple part files.
Segments are typically named archive.sit.1, archive.sit.2, etc.
This method concatenates all segments and parses the combined data.
§Arguments
paths- Slice of paths to segment files, in order (segment 1 first)
§Example
let paths = vec!["archive.sit.1", "archive.sit.2", "archive.sit.3"];
let archive = SitArchive::parse_segmented(&paths)?;Sourcepub fn parse_encrypted(data: &[u8], password: &str) -> Result<Self, SitError>
pub fn parse_encrypted(data: &[u8], password: &str) -> Result<Self, SitError>
Parse a password-protected StuffIt archive.
This method handles both SIT5 and Classic encrypted archives. For SIT5, it uses dual MD5 password verification. For Classic, it uses XOR-based decryption.
§Arguments
data- Raw archive bytespassword- Password string
§Example
let data = std::fs::read("encrypted.sit")?;
let archive = SitArchive::parse_encrypted(&data, "secret")?;Trait Implementations§
Source§impl Clone for SitArchive
impl Clone for SitArchive
Source§fn clone(&self) -> SitArchive
fn clone(&self) -> SitArchive
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more