@@ -55,11 +55,14 @@ enum StreamTable<'s> {
5555
5656 // Given the table location, we can access the stream table itself
5757 Available {
58- stream_table_view : Box < dyn SourceView < ' s > > ,
58+ stream_table_view : Box < dyn SourceView < ' s > + Send > ,
5959 } ,
6060}
6161
62- fn view < ' s > ( source : & mut dyn Source < ' s > , page_list : & PageList ) -> Result < Box < dyn SourceView < ' s > > > {
62+ fn view < ' s > (
63+ source : & mut dyn Source < ' s > ,
64+ page_list : & PageList ,
65+ ) -> Result < Box < dyn SourceView < ' s > + Send + Sync > > {
6366 // view it
6467 let view = source. view ( page_list. source_slices ( ) ) ?;
6568
@@ -120,7 +123,10 @@ mod big {
120123 }
121124
122125 impl < ' s , S : Source < ' s > > BigMSF < ' s , S > {
123- pub fn new ( source : S , header_view : Box < dyn SourceView < ' _ > > ) -> Result < BigMSF < ' s , S > > {
126+ pub fn new (
127+ source : S ,
128+ header_view : Box < dyn SourceView < ' _ > + Send > ,
129+ ) -> Result < BigMSF < ' s , S > > {
124130 let mut buf = ParseBuffer :: from ( header_view. as_slice ( ) ) ;
125131 let header: RawHeader = buf. parse ( ) ?;
126132
@@ -316,7 +322,7 @@ mod big {
316322 }
317323 }
318324
319- impl < ' s , S : Source < ' s > > Msf < ' s , S > for BigMSF < ' s , S > {
325+ impl < ' s , S : Source < ' s > + Send > Msf < ' s , S > for BigMSF < ' s , S > {
320326 fn get ( & mut self , stream_number : u32 , limit : Option < usize > ) -> Result < Stream < ' s > > {
321327 // look up the stream
322328 let mut page_list = self . look_up_stream ( stream_number) ?;
@@ -345,7 +351,7 @@ mod small {
345351/// Represents a single Stream within the multi-stream file.
346352#[ derive( Debug ) ]
347353pub struct Stream < ' s > {
348- source_view : Box < dyn SourceView < ' s > > ,
354+ source_view : Box < dyn SourceView < ' s > + Send + Sync > ,
349355}
350356
351357impl < ' s > Stream < ' s > {
@@ -380,7 +386,9 @@ fn header_matches(actual: &[u8], expected: &[u8]) -> bool {
380386 actual. len ( ) >= expected. len ( ) && & actual[ 0 ..expected. len ( ) ] == expected
381387}
382388
383- pub fn open_msf < ' s , S : Source < ' s > + ' s > ( mut source : S ) -> Result < Box < dyn Msf < ' s , S > + ' s > > {
389+ pub fn open_msf < ' s , S : Source < ' s > + Send + ' s > (
390+ mut source : S ,
391+ ) -> Result < Box < dyn Msf < ' s , S > + Send + ' s > > {
384392 // map the header
385393 let mut header_location = PageList :: new ( 4096 ) ;
386394 header_location. push ( 0 ) ;
0 commit comments