Struct ldap3::EntryStream
[−]
[src]
pub struct EntryStream { /* fields omitted */ }
Handle for obtaining a stream of search results.
A streaming search should be used for situations where the expected size of result entries varies considerably between searches, and/or can rise above a few tens to hundreds of KB. This is more of a concern for a long-lived process which is expected to have a predictable memory footprint (i.e., a server), but can also help with one-off searches if the result set is in the tens of thounsands of entries.
Once initiated, a streaming search must either be driven to the end by
repeatedly calling next()
until it returns Ok(None)
or an Error, or cancelled by calling abandon()
with the request id obtained by calling id()
on the
stream handle.
After regular termination or cancellation, the overall result of the
search must be retrieved by calling result()
on
the stream handle.
Methods
impl EntryStream
[src]
fn next(&mut self) -> Result<Option<StructureTag>>
Retrieve the next search result. Ok(None)
signals the end of the
stream.
fn result(&mut self) -> Result<(LdapResult, Vec<Control>)>
Retrieve the overall result of the search. This method must be
called after the stream has terminated by returning Ok(None)
or
an error, although the latter case is guaranteed to also return an
error. If this protocol is not followed, the method will hang.
fn id(&mut self) -> Option<RequestId>
Get the internal RequestId
of the search, which can be used to
abandon it. The method returns None
if the stream is in the
errored state at the time of call.
Note: this method will probably be deprecated or removed in
the 0.5.x version of the library, in favor of directly calling
abandon()
on the stream.