pub struct GraphWalk {
pub direction: WalkDirection,
pub weight_floor: Option<f64>,
pub max_hops: u32,
pub max_neighbors_per_hop: Option<usize>,
pub relation_filter: Option<String>,
}Expand description
Traversal parameters. Every caller states its own explicitly.
Fields§
§direction: WalkDirectionDirected or bidirectional edge following.
weight_floor: Option<f64>Minimum edge weight; None follows every edge regardless of weight.
max_hops: u32Maximum hop distance from the seeds.
max_neighbors_per_hop: Option<usize>Keep only the first k unvisited neighbours of each expansion.
relation_filter: Option<String>Follow only edges carrying this relation label.
Implementations§
Source§impl GraphWalk
impl GraphWalk
Sourcepub fn directed(min_weight: f64, max_hops: u32) -> Self
pub fn directed(min_weight: f64, max_hops: u32) -> Self
Directed walk with a weight floor — the shape used by recall, hybrid-search and deep-research.
Sourcepub fn bidirectional(min_weight: f64, max_hops: u32) -> Self
pub fn bidirectional(min_weight: f64, max_hops: u32) -> Self
Bidirectional walk with a weight floor — the shape used by related.
Sourcepub fn with_neighbor_cap(self, cap: Option<usize>) -> Self
pub fn with_neighbor_cap(self, cap: Option<usize>) -> Self
Sets the per-expansion neighbour cap.
Sourcepub fn with_relation_filter(self, relation: Option<String>) -> Self
pub fn with_relation_filter(self, relation: Option<String>) -> Self
Restricts the walk to a single relation label.
Sourcepub fn run<S: NeighborSource>(
&self,
source: &S,
seed_entity_ids: &[i64],
) -> Result<WalkOutcome, AppError>
pub fn run<S: NeighborSource>( &self, source: &S, seed_entity_ids: &[i64], ) -> Result<WalkOutcome, AppError>
Runs the walk, discarding per-edge observations.
§Errors
Propagates AppError::Database (exit 10) on SQLite query failures.
Sourcepub fn run_observed<S, F>(
&self,
source: &S,
seed_entity_ids: &[i64],
on_edge: F,
) -> Result<WalkOutcome, AppError>
pub fn run_observed<S, F>( &self, source: &S, seed_entity_ids: &[i64], on_edge: F, ) -> Result<WalkOutcome, AppError>
Runs the walk, invoking on_edge(edge, depth_of_neighbour) for every
edge examined — including edges that lead back to an already-visited
entity. Callers that render an edge list (graph traverse) need those;
callers that only need reachable entities ignore them.
§Errors
Propagates AppError::Database (exit 10) on SQLite query failures.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GraphWalk
impl RefUnwindSafe for GraphWalk
impl Send for GraphWalk
impl Sync for GraphWalk
impl Unpin for GraphWalk
impl UnsafeUnpin for GraphWalk
impl UnwindSafe for GraphWalk
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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