Module ldap3::adapters[][src]

Search operation adapters.

A Search operation can return various objects in addition to directory entries, such as referrals or intermediate messages, which may or may not be of interest to the user invoking the operation. Some search operations will effectively span several discrete Search protocol exchanges, as is the case for searches using the Paged Results control, or distributed searches with referral chasing. Search adapters provide a mechanism to hand control of the operation to user-defined code capable of handling such use cases, while presenting the invoker with the same result-gathering interface.

An adapter is a struct implementing the Adapter trait. A single adapter struct or a vector of Adapter trait objects can be passed to the streaming_search_with() method on the Ldap handle along with regular Search parameters to create an adapted search. Calling the stream methods on the returned handle will execute the chain of Adapter methods from each adapter in turn, ending with the direct call of the regular stream method.

Adapters must be written with async calls, but work equally well for both async and sync versions of the API because the sync API is just a blocking façade for the async one.

Structs

EntriesOnly

Adapter which returns just the directory entries.

PagedResults

Adapter which fetches Search results with a Paged Results control.

Traits

Adapter

Adapter interface to a Search.

AdapterClone

Helper trait to enforce Clone on Adapter implementors.

IntoAdapterVec

Helper trait for Adapter instance/chain conversions.

SoloMarker

Marker trait for convenient single-adapter searches.