impl Send + Sync mark for archive extract API (#12)

This commit is contained in:
2026-04-13 15:35:01 +08:00
parent 034f4f7a52
commit 4f7d696dbe
21 changed files with 96 additions and 78 deletions

View File

@@ -144,7 +144,7 @@ pub struct SoftpalPacArchive<'a, T: Read + Seek + std::fmt::Debug + 'a> {
_mark: std::marker::PhantomData<&'a ()>,
}
impl<'a, T: Read + Seek + std::fmt::Debug + 'a> SoftpalPacArchive<'a, T> {
impl<'a, T: Read + Seek + std::fmt::Debug + Send + Sync + 'a> SoftpalPacArchive<'a, T> {
fn new(
mut reader: T,
archive_encoding: Encoding,
@@ -237,7 +237,7 @@ impl<'a, T: Read + Seek + std::fmt::Debug + 'a> SoftpalPacArchive<'a, T> {
}
}
impl<'b, T: Read + Seek + std::fmt::Debug + 'b> Script for SoftpalPacArchive<'b, T> {
impl<'b, T: Read + Seek + std::fmt::Debug + Send + Sync + 'b> Script for SoftpalPacArchive<'b, T> {
fn default_output_script_type(&self) -> OutputScriptType {
OutputScriptType::Json
}
@@ -264,7 +264,7 @@ impl<'b, T: Read + Seek + std::fmt::Debug + 'b> Script for SoftpalPacArchive<'b,
))
}
fn open_file<'a>(&'a self, index: usize) -> Result<Box<dyn ArchiveContent + 'a>> {
fn open_file<'a>(&'a self, index: usize) -> Result<Box<dyn ArchiveContent + Send + Sync + 'a>> {
let entry = self
.entries
.get(index)