server: refactor ldap_handler

Split it into several files, move them into the domain folder, introduce
`LdapError` for better control flow.
This commit is contained in:
Valentin Tolmer
2022-10-17 14:03:31 +02:00
committed by nitnelave
parent 0be440efc8
commit 35aa656677
7 changed files with 820 additions and 787 deletions

View File

@@ -0,0 +1,17 @@
use ldap3_proto::LdapResultCode;
#[derive(Debug, PartialEq)]
pub struct LdapError {
pub code: LdapResultCode,
pub message: String,
}
impl std::fmt::Display for LdapError {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.message)
}
}
impl std::error::Error for LdapError {}
pub type LdapResult<T> = std::result::Result<T, LdapError>;