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 more