Enum ldap3::StreamState [−][src]
Possible states of a SearchStream
.
SearchStream
call/state conceptual diagram
Columns depict method call chains. The Inner row is the final call destination for all stream variants. At the bottom of each column is the expected state before the call to a method. Numbers in call site boxes are the points of state transitions.
SearchStream
has two variants, direct and adapted, differentiated by the size of
the adapter vector. The direct version, with an empty vector, is the regular one;
the adapted version passes each method call through a chain of adapters before executing
the direct call. In the diagram, direct calls start from the top of the column, while adapted
calls start at the bottom.
Every SearchStream
is created in the Fresh
state, and the start()
method is automatically
called. The start()
method, although publicly visible so that adapter chaining can work, is
not meant for calls from user code. It will change the state from Fresh
to Active
at point (1),
when the protocol request is successfully written to the network socket. Any error in submitting
the request will change the state to Error
. Calling start()
in any state but Fresh
will just
immediately return.
Iterating through the stream with next()
requires the Active
state, which turns into Done
when the final Search message is received. However, the transition must not be made in the
inner method, since the adapters may need to keep providing additional entries even when
the original operation is over. Therefore, point (2) occurs at the end of the first call
in the chain (for the adapted streams), or in the shim method (for the direct ones). As before,
any error will result in the Error
state.
The finish()
method may be called at any time. Adapters along the way can behave differently
according to the state, and the final direct call will change the state to Closed
at (3). Calling
finish()
on a stream in the Closed
state will return a synthetic error-bearing LdapResult
.
Variants
Stream which hasn’t yet been initialized in start()
.
Initialized stream which can be iterated through with next()
.
Stream from which all entries have been retrieved.
Properly finalized stream on which finish()
was called.
Stream in an error state after some fallible operation.
Trait Implementations
impl Clone for StreamState
[src]
fn clone(&self) -> StreamState
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for StreamState
[src]
impl Debug for StreamState
[src]
impl Eq for StreamState
[src]
impl PartialEq<StreamState> for StreamState
[src]
fn eq(&self, other: &StreamState) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for StreamState
[src]
impl StructuralPartialEq for StreamState
[src]
Auto Trait Implementations
impl RefUnwindSafe for StreamState
impl Send for StreamState
impl Sync for StreamState
impl Unpin for StreamState
impl UnwindSafe for StreamState
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,