pub struct LdapConn { /* private fields */ }
sync
only.Expand description
Synchronous connection to an LDAP server.
In this version of the interface, new()
will return
a struct encapsulating a runtime, the connection, and an operation handle. All
operations are performed through that struct, synchronously: the thread will
wait until the result is available or the operation times out.
The API is virtually identical to the asynchronous one. The chief difference is
that LdapConn
is not cloneable: if you need another handle, you must open a
new connection.
Implementations§
source§impl LdapConn
impl LdapConn
sourcepub fn new(url: &str) -> Result<Self>
pub fn new(url: &str) -> Result<Self>
Open a connection to an LDAP server specified by url
.
See LdapConnAsync::new() for the details of the supported URL formats.
sourcepub fn with_settings(settings: LdapConnSettings, url: &str) -> Result<Self>
pub fn with_settings(settings: LdapConnSettings, url: &str) -> Result<Self>
Open a connection to an LDAP server specified by url
, using
settings
to specify additional parameters.
sourcepub fn from_url(url: &Url) -> Result<Self>
pub fn from_url(url: &Url) -> Result<Self>
Open a connection to an LDAP server specified by an already parsed Url
.
sourcepub fn from_url_with_settings(
settings: LdapConnSettings,
url: &Url
) -> Result<Self>
pub fn from_url_with_settings( settings: LdapConnSettings, url: &Url ) -> Result<Self>
Open a connection to an LDAP server specified by an already parsed Url
, using
settings
to specify additional parameters.
sourcepub fn with_search_options(&mut self, opts: SearchOptions) -> &mut Self
pub fn with_search_options(&mut self, opts: SearchOptions) -> &mut Self
sourcepub fn with_controls<V: IntoRawControlVec>(&mut self, ctrls: V) -> &mut Self
pub fn with_controls<V: IntoRawControlVec>(&mut self, ctrls: V) -> &mut Self
sourcepub fn with_timeout(&mut self, duration: Duration) -> &mut Self
pub fn with_timeout(&mut self, duration: Duration) -> &mut Self
See Ldap::with_timeout()
.
sourcepub fn simple_bind(
&mut self,
bind_dn: &str,
bind_pw: &str
) -> Result<LdapResult>
pub fn simple_bind( &mut self, bind_dn: &str, bind_pw: &str ) -> Result<LdapResult>
See Ldap::simple_bind()
.
sourcepub fn sasl_external_bind(&mut self) -> Result<LdapResult>
pub fn sasl_external_bind(&mut self) -> Result<LdapResult>
sourcepub fn sasl_gssapi_bind(&mut self, server_fqdn: &str) -> Result<LdapResult>
Available on crate feature gssapi
only.
pub fn sasl_gssapi_bind(&mut self, server_fqdn: &str) -> Result<LdapResult>
gssapi
only.sourcepub fn search<'a, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>(
&mut self,
base: &str,
scope: Scope,
filter: &str,
attrs: A
) -> Result<SearchResult>
pub fn search<'a, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>( &mut self, base: &str, scope: Scope, filter: &str, attrs: A ) -> Result<SearchResult>
See Ldap::search()
.
sourcepub fn streaming_search<'a, 'b, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>(
&'b mut self,
base: &str,
scope: Scope,
filter: &str,
attrs: A
) -> Result<EntryStream<'a, 'b, S, A>>
pub fn streaming_search<'a, 'b, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>( &'b mut self, base: &str, scope: Scope, filter: &str, attrs: A ) -> Result<EntryStream<'a, 'b, S, A>>
Perform a Search, but unlike search()
, which returns all results at once, return a handle which
will be used for retrieving entries one by one. See EntryStream
for the explanation of the protocol which must be adhered to in this case.
sourcepub fn streaming_search_with<'a, 'b, V: IntoAdapterVec<'a, S, A>, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>(
&'b mut self,
adapters: V,
base: &str,
scope: Scope,
filter: &str,
attrs: A
) -> Result<EntryStream<'a, 'b, S, A>>
pub fn streaming_search_with<'a, 'b, V: IntoAdapterVec<'a, S, A>, S: AsRef<str> + Send + Sync + 'a, A: AsRef<[S]> + Send + Sync + 'a>( &'b mut self, adapters: V, base: &str, scope: Scope, filter: &str, attrs: A ) -> Result<EntryStream<'a, 'b, S, A>>
Perform a streaming Search internally modified by a chain of adapters.
See Ldap::streaming_search_with()
.
sourcepub fn add<S: AsRef<[u8]> + Eq + Hash>(
&mut self,
dn: &str,
attrs: Vec<(S, HashSet<S>)>
) -> Result<LdapResult>
pub fn add<S: AsRef<[u8]> + Eq + Hash>( &mut self, dn: &str, attrs: Vec<(S, HashSet<S>)> ) -> Result<LdapResult>
See Ldap::add()
.
sourcepub fn compare<B: AsRef<[u8]>>(
&mut self,
dn: &str,
attr: &str,
val: B
) -> Result<CompareResult>
pub fn compare<B: AsRef<[u8]>>( &mut self, dn: &str, attr: &str, val: B ) -> Result<CompareResult>
See Ldap::compare()
.
sourcepub fn delete(&mut self, dn: &str) -> Result<LdapResult>
pub fn delete(&mut self, dn: &str) -> Result<LdapResult>
See Ldap::delete()
.
sourcepub fn modify<S: AsRef<[u8]> + Eq + Hash>(
&mut self,
dn: &str,
mods: Vec<Mod<S>>
) -> Result<LdapResult>
pub fn modify<S: AsRef<[u8]> + Eq + Hash>( &mut self, dn: &str, mods: Vec<Mod<S>> ) -> Result<LdapResult>
See Ldap::modify()
.
sourcepub fn modifydn(
&mut self,
dn: &str,
rdn: &str,
delete_old: bool,
new_sup: Option<&str>
) -> Result<LdapResult>
pub fn modifydn( &mut self, dn: &str, rdn: &str, delete_old: bool, new_sup: Option<&str> ) -> Result<LdapResult>
See Ldap::modifydn()
.
sourcepub fn unbind(&mut self) -> Result<()>
pub fn unbind(&mut self) -> Result<()>
See Ldap::unbind()
.
sourcepub fn extended<E>(&mut self, exop: E) -> Result<ExopResult>where
E: Into<Exop>,
pub fn extended<E>(&mut self, exop: E) -> Result<ExopResult>where E: Into<Exop>,
See Ldap::extended()
.
sourcepub fn last_id(&mut self) -> RequestId
pub fn last_id(&mut self) -> RequestId
See Ldap::last_id()
.
sourcepub fn is_closed(&mut self) -> bool
pub fn is_closed(&mut self) -> bool
See Ldap::is_closed()
.