pub struct ClientBuilder { /* private fields */ }Implementations§
Source§impl ClientBuilder
impl ClientBuilder
pub fn new(host: impl Into<String>, port: u16) -> Self
pub fn from_url(url: &str) -> Result<Self, Error>
pub fn transport(self, transport: Transport) -> Self
Sourcepub fn tls_config(self, config: Arc<ClientConfig>) -> Self
pub fn tls_config(self, config: Arc<ClientConfig>) -> Self
Set the TLS configuration from a pre-built rustls::ClientConfig.
For a higher-level API, see tls.
Sourcepub fn tls(self, config: TlsConfig) -> Result<Self, Error>
pub fn tls(self, config: TlsConfig) -> Result<Self, Error>
Build and set the TLS configuration from a TlsConfig.
Returns Err if certificate loading fails.
pub fn connect_timeout(self, timeout: Duration) -> Self
pub fn request_timeout(self, timeout: Duration) -> Self
pub fn base_dn(self, base_dn: impl Into<String>) -> Self
Sourcepub fn service_account(
self,
dn: impl Into<String>,
password: SecretString,
) -> Self
pub fn service_account( self, dn: impl Into<String>, password: SecretString, ) -> Self
Set the service account that Client::rebind_service_account and
Client::reconnect bind with. A DN with an empty password is refused
by connect as Error::UnauthenticatedBind.
pub fn referral_policy(self, policy: ReferralPolicy) -> Self
Sourcepub fn referral_credentials(self, credentials: ReferralCredentials) -> Self
pub fn referral_credentials(self, credentials: ReferralCredentials) -> Self
Choose what a connection opened to follow a referral binds as (anonymous by default).
Sourcepub fn max_message_size(self, max: u32) -> Self
pub fn max_message_size(self, max: u32) -> Self
Set the maximum accepted LDAP message size (10 MiB by default).
Sourcepub fn on_unsolicited_notification(
self,
handler: impl Fn(&ExtendedResponse) + Send + Sync + 'static,
) -> Self
pub fn on_unsolicited_notification( self, handler: impl Fn(&ExtendedResponse) + Send + Sync + 'static, ) -> Self
Register a callback for unsolicited notifications (message-id 0) other
than the Notice of Disconnection. The default handler logs the event at
debug level.
pub async fn connect(self) -> Result<Client, Error>
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Forget for ClientBuilder
impl Freeze for ClientBuilder
impl Move for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more