You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: ldap_handler.rs
    path of file: ./repos/lldap/server/src/infra
    
    the code of the file until where you have to start completion: use crate::{
    domain::{
        handler::{
            BackendHandler, BindRequest, CreateUserRequest, LoginHandler, ReadSchemaBackendHandler,
        },
        ldap::{
            error::{LdapError, LdapResult},
            group::{convert_groups_to_ldap_op, get_groups_list},
            user::{convert_users_to_ldap_op, get_user_list},
            utils::{
                get_user_id_from_distinguished_name, is_subtree, parse_distinguished_name, LdapInfo,
            },
        },
        opaque_handler::OpaqueHandler,
        schema::PublicSchema,
        types::{AttributeName, Email, Group, JpegPhoto, UserAndGroups, UserId},
    },
    infra::access_control::{
        AccessControlledBackendHandler, AdminBackendHandler, UserAndGroupListerBackendHandler,
        UserReadableBackendHandler, ValidationResults,
    },
};
use anyhow::Result;
use ldap3_proto::proto::{
    LdapAddRequest, LdapBindCred, LdapBindRequest, LdapBindResponse, LdapCompareRequest,
    LdapDeref
    
    pub async fn do_bind(&mut self, request: &LdapBindRequest) -> (LdapResultCode, String) {
        let user_id = match get_user_id_from_distinguished_name(
            &request.dn.to_ascii_lowercase(),
            &self.ldap_info.base_dn,
            &self.ldap_info.base_dn_str,
        ) {
            Ok(s) => s,
            Err(e) => return (LdapResultCode::NamingViolation, e.to_string()),
        };
        let password = if let LdapBindCred::Simple(password) = &request.cred {
            password
        } else {
            return (
                LdapResultCode::UnwillingToPerform,
                "SASL not supported".to_string(),
            );
        };
        match self
            .get_login_handler()
            .bind(BindRequest {
                name: user_id.clone(),
                password: password.clone(),
            })
            .await
        {
            Ok(()) => {
                self.user_info = self
                    .backend_handler
                    .get_permissions_for_user(user_id)
                    .await
                    .ok();
                debug!("Success!");
                (LdapResultCode::Success, "".to_string())
            }
            Err(_) => (LdapResultCode::InvalidCredentials, "".to_string()),
        }
    }