diff --git a/src/pxar/decoder.rs b/src/pxar/decoder.rs index df636501..9b07aed7 100644 --- a/src/pxar/decoder.rs +++ b/src/pxar/decoder.rs @@ -33,7 +33,7 @@ impl ReadSeek for R {} // This one needs Read+Seek pub struct Decoder { - inner: SequentialDecoder>, + inner: SequentialDecoder>, root_start: u64, root_end: u64, } @@ -42,15 +42,15 @@ const HEADER_SIZE: u64 = std::mem::size_of::() as u64; const GOODBYE_ITEM_SIZE: u64 = std::mem::size_of::() as u64; impl Decoder { - pub fn new(mut reader: R) -> Result { + pub fn new(mut reader: R) -> Result { let root_end = reader.seek(SeekFrom::End(0))?; - let boxed_reader: Box = Box::new(reader); + let boxed_reader: Box = Box::new(reader); let inner = SequentialDecoder::new(boxed_reader, super::flags::DEFAULT); Ok(Self { inner, root_start: 0, root_end }) } - pub fn set_callback Result<(), Error> + 'static>(&mut self, callback: F ) { + pub fn set_callback Result<(), Error> + Send + 'static>(&mut self, callback: F ) { self.inner.set_callback(callback); } diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 6364fe5a..012991a6 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -35,7 +35,7 @@ pub struct SequentialDecoder { feature_flags: u64, allow_existing_dirs: bool, skip_buffer: Vec, - callback: Option Result<(), Error>>>, + callback: Option Result<(), Error> + Send>>, } const HEADER_SIZE: u64 = std::mem::size_of::() as u64; @@ -57,7 +57,7 @@ impl SequentialDecoder { } } - pub fn set_callback Result<(), Error> + 'static>(&mut self, callback: F ) { + pub fn set_callback Result<(), Error> + Send + 'static>(&mut self, callback: F ) { self.callback = Some(Box::new(callback)); }