pub trait ArchiveHandler {
// Required methods
fn pack(
&self,
files: &[(&str, &[u8])],
format: ArchiveFormat,
) -> Result<Bytes, ArchiveError>;
fn unpack(
&self,
archive: &[u8],
format: ArchiveFormat,
) -> Result<Vec<(String, Bytes)>, ArchiveError>;
}Expand description
Multi-carrier archive port (ZIP / TAR / TAR.GZ).
Required Methods§
Sourcefn pack(
&self,
files: &[(&str, &[u8])],
format: ArchiveFormat,
) -> Result<Bytes, ArchiveError>
fn pack( &self, files: &[(&str, &[u8])], format: ArchiveFormat, ) -> Result<Bytes, ArchiveError>
Pack files (name, bytes) into an archive of format.
§Errors
Returns ArchiveError::PackFailed or
ArchiveError::UnsupportedFormat.
Sourcefn unpack(
&self,
archive: &[u8],
format: ArchiveFormat,
) -> Result<Vec<(String, Bytes)>, ArchiveError>
fn unpack( &self, archive: &[u8], format: ArchiveFormat, ) -> Result<Vec<(String, Bytes)>, ArchiveError>
Unpack archive of format into (name, bytes) pairs.
§Errors
Returns ArchiveError::UnpackFailed or
ArchiveError::UnsupportedFormat.