@@ -138,6 +138,7 @@ use std::{
138138
139139use filter:: { AndFilter , EqFilter , Filter , OrFilter } ;
140140use futures:: { Stream , StreamExt , executor:: block_on, stream} ;
141+ use std:: pin:: Pin ;
141142use ldap3:: {
142143 Ldap , LdapConnAsync , LdapConnSettings , LdapError , LdapResult , Mod , Scope , SearchEntry ,
143144 SearchStream , StreamState ,
@@ -656,7 +657,7 @@ impl LdapClient {
656657 scope : Scope ,
657658 filter : & F ,
658659 attributes : A ,
659- ) -> Result < impl Stream < Item = Result < Record , Error > > + use < ' a , F , A , S > , Error >
660+ ) -> Result < Pin < Box < dyn Stream < Item = Result < Record , Error > > + ' a > > , Error >
660661 where
661662 F : Filter ,
662663 A : AsRef < [ S ] > + Send + Sync + ' a ,
@@ -778,7 +779,7 @@ impl LdapClient {
778779 filter : & F ,
779780 attributes : A ,
780781 page_size : i32 ,
781- ) -> Result < impl Stream < Item = Result < Record , Error > > + use < ' a , F , A , S > , Error >
782+ ) -> Result < Pin < Box < dyn Stream < Item = Result < Record , Error > > + ' a > > , Error >
782783 where
783784 F : Filter ,
784785 // PagedResults requires Clone and Debug too.
@@ -1789,7 +1790,7 @@ where
17891790/// A helper to create native rust streams out of `ldap3::SearchStream`s.
17901791fn to_native_stream < ' a , S , A > (
17911792 ldap3_stream : SearchStream < ' a , S , A > ,
1792- ) -> Result < impl Stream < Item = Result < Record , Error > > + use < ' a , S , A > , Error >
1793+ ) -> Result < Pin < Box < dyn Stream < Item = Result < Record , Error > > + ' a > > , Error >
17931794where
17941795 S : AsRef < str > + Send + Sync + ' a ,
17951796 A : AsRef < [ S ] > + Send + Sync + ' a ,
@@ -1818,7 +1819,7 @@ where
18181819 }
18191820 } ) ;
18201821
1821- Ok ( stream)
1822+ Ok ( Box :: pin ( stream) )
18221823}
18231824
18241825/// The Record struct is used to map the search result to a struct.
0 commit comments