pub trait LdapOperations: Send + Sync {
// Required methods
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn bind<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
dn: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn search<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
base: &'life1 str,
filter: &'life2 str,
attrs: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<LdapAuthResult>, LdapError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<LdapAuthResult, LdapError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Trait for LDAP operations.
This trait abstracts LDAP operations to allow for different implementations (real LDAP client, mock for testing, etc.)
Required Methods§
Sourcefn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn connect<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Connect to the LDAP server.
Sourcefn bind<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
dn: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn bind<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
dn: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Bind with credentials.
Sourcefn search<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
base: &'life1 str,
filter: &'life2 str,
attrs: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<LdapAuthResult>, LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn search<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
base: &'life1 str,
filter: &'life2 str,
attrs: &'life3 [&'life4 str],
) -> Pin<Box<dyn Future<Output = Result<Vec<LdapAuthResult>, LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Search for entries.
Sourcefn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<LdapAuthResult, LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn authenticate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
username: &'life1 str,
password: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<LdapAuthResult, LdapError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Authenticate a user and return their info.