inejge / ldap3

A pure-Rust LDAP library using the Tokio stack
Apache License 2.0
226 stars 39 forks source link

Allow search without mut #58

Closed andrewbanchich closed 4 years ago

andrewbanchich commented 4 years ago

I am trying to make an LDAP connection and then use it concurrently to make search requests, however I'm not able to because all search APIs take &mut self. Is there any way this could be changed so that a connection can be shared across concurrent tasks?

inejge commented 4 years ago

Are you using the synchronous or the asynchronous API?

andrewbanchich commented 4 years ago

sync, but only because the docs show LdapConnAsync also returns a normal ldap3::Ldap, which is what we search with.

andrewbanchich commented 4 years ago

Ah, I just noticed the docs say Ldap can be cloned, so I assume that's the proper way of handling this. Feel free to close this if so.

Thanks! 😄

inejge commented 4 years ago

Heh, seems I'm late with the response :wink: Yes, Ldap is cheap to clone on purpose, and it's the proper way to obtain a new handle.