pub enum OidOrdering {
Strict,
AllowNonIncreasing,
}Expand description
OID ordering behavior during walk operations.
SNMP walks rely on agents returning OIDs in strictly increasing lexicographic order. However, some buggy agents violate this requirement, returning OIDs out of order or even repeating OIDs (which would cause infinite loops).
This enum controls how the library handles ordering violations:
-
Strict(default): Terminates immediately withError::WalkAbortedon any violation. Use this unless you know the agent has ordering bugs. -
AllowNonIncreasing: Tolerates out-of-order OIDs but tracks all seen OIDs to detect cycles. ReturnsError::WalkAbortedif the same OID appears twice.
Variants§
Strict
Require strictly increasing OIDs (default).
Walk terminates with Error::WalkAborted
on first violation. Most efficient: O(1) memory, O(1) per-item check.
AllowNonIncreasing
Allow non-increasing OIDs, with cycle detection.
Some buggy agents return OIDs out of order. This mode tracks all seen OIDs in a HashSet to detect cycles, terminating with an error if the same OID is returned twice.
Warning: This uses O(n) memory where n = number of walk results.
Always pair with ClientBuilder::max_walk_results to bound memory
usage. Cycle detection only catches duplicate OIDs; a pathological
agent could still return an infinite sequence of unique OIDs within
the subtree.
Trait Implementations§
Source§impl Clone for OidOrdering
impl Clone for OidOrdering
Source§fn clone(&self) -> OidOrdering
fn clone(&self) -> OidOrdering
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OidOrdering
impl Debug for OidOrdering
Source§impl Default for OidOrdering
impl Default for OidOrdering
Source§fn default() -> OidOrdering
fn default() -> OidOrdering
Source§impl PartialEq for OidOrdering
impl PartialEq for OidOrdering
impl Copy for OidOrdering
impl Eq for OidOrdering
impl StructuralPartialEq for OidOrdering
Auto Trait Implementations§
impl Freeze for OidOrdering
impl RefUnwindSafe for OidOrdering
impl Send for OidOrdering
impl Sync for OidOrdering
impl Unpin for OidOrdering
impl UnsafeUnpin for OidOrdering
impl UnwindSafe for OidOrdering
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more