igraph_dfshandler_t

Type Alias igraph_dfshandler_t 

Source
pub type igraph_dfshandler_t = Option<unsafe extern "C" fn(graph: *const igraph_t, vid: igraph_int_t, dist: igraph_int_t, extra: *mut c_void) -> igraph_error_t>;
Expand description

\function igraph_dfshandler_t \brief Callback type for the DFS function.

\ref igraph_dfs() is able to call a callback function, whenever a new vertex is discovered, and/or whenever a subtree is completed. These callbacks must be of type \c igraph_dfshandler_t. They have the following arguments:

\param graph The graph that the algorithm is working on. Of course this must not be modified. \param vid The id of the vertex just found by the depth-first search. \param dist The distance (number of hops) of the current vertex from the root of the current search tree. \param extra The extra argument that was passed to \ref igraph_dfs(). \return \c IGRAPH_SUCCESS if the DFS should continue, \c IGRAPH_STOP if the DFS should stop and return to the caller normally. Any other value is treated as an igraph error code, terminating the search and returning to the caller with the same error code. If a DFS is is terminated prematurely, then all elements of the result vectors that were not yet calculated at the point of the termination contain negative values.

\sa \ref igraph_dfs()

Aliased Type§

pub enum igraph_dfshandler_t {
    None,
    Some(unsafe extern "C" fn(*const igraph_t, i64, i64, *mut c_void) -> u32),
}

Variants§

§1.0.0

None

No value.

§1.0.0

Some(unsafe extern "C" fn(*const igraph_t, i64, i64, *mut c_void) -> u32)

Some value of type T.