pub enum TraversalPattern {
Unknown,
Linear,
Branching,
}Expand description
Traversal pattern classification.
Represents the detected traversal pattern based on observed node degrees. This classification determines whether sequential I/O optimization should be applied.
§Variants
- Unknown: Not enough data to classify (0-2 observations, or degree 0 encountered)
- Linear: Confirmed linear pattern (3+ consecutive degree-1 steps)
- Branching: Branching detected (degree > 1 at any point)
§Example
use crate::backend::native::adjacency::{LinearDetector, TraversalPattern};
let mut detector = LinearDetector::new();
// First observation: degree 1
assert_eq!(detector.observe(1, 1), TraversalPattern::Unknown);
// Second observation: degree 1
assert_eq!(detector.observe(2, 1), TraversalPattern::Unknown);
// Third observation: degree 1 - threshold reached!
assert_eq!(detector.observe(3, 1), TraversalPattern::Linear);
// Fourth observation: degree 2 - branching detected
assert_eq!(detector.observe(4, 2), TraversalPattern::Branching);Variants§
Unknown
Not enough data to classify pattern
Linear
Confirmed linear: 3+ consecutive degree-1 steps
Branching
Branching detected: degree > 1 at any point
Trait Implementations§
Source§impl Clone for TraversalPattern
impl Clone for TraversalPattern
Source§fn clone(&self) -> TraversalPattern
fn clone(&self) -> TraversalPattern
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TraversalPattern
impl Debug for TraversalPattern
Source§impl PartialEq for TraversalPattern
impl PartialEq for TraversalPattern
impl Copy for TraversalPattern
impl Eq for TraversalPattern
impl StructuralPartialEq for TraversalPattern
Auto Trait Implementations§
impl Freeze for TraversalPattern
impl RefUnwindSafe for TraversalPattern
impl Send for TraversalPattern
impl Sync for TraversalPattern
impl Unpin for TraversalPattern
impl UnwindSafe for TraversalPattern
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
Mutably borrows from an owned value. Read more
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§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
Compare self to
key and return true if they are equal.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>
Converts
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>
Converts
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