odgi-ffi 1.1.3

A safe, ergonomic Rust wrapper for the odgi pangenome graph tool.
Documentation
// File: src/odgi_wrapper.hpp
#pragma once

#include "odgi.hpp"
#include "rust/cxx.h"
#include <memory>

// OpaqueGraph is defined in the global namespace.
struct OpaqueGraph {
    std::unique_ptr<odgi::graph_t> graph;
};

// The function declarations.
// Note: odgi::Edge and odgi::PathPosition are now known types because
// our .cpp file will include the header generated by cxx.
namespace odgi {
struct Edge;
struct PathPosition;
}


std::unique_ptr<OpaqueGraph> load_graph(rust::Str path);
const odgi::graph_t& get_graph_t(const OpaqueGraph& graph);
uint64_t get_node_count(const odgi::graph_t& graph);

rust::Vec<rust::String> graph_get_path_names(const odgi::graph_t& graph);
// CORRECTED: Update signature to match the bridge
std::unique_ptr<odgi::PathPosition> graph_project(const odgi::graph_t& graph, rust::Str path_name, uint64_t pos);
rust::String graph_get_node_sequence(const odgi::graph_t& graph, uint64_t node_id);
uint64_t graph_get_node_len(const odgi::graph_t& graph, uint64_t node_id);
rust::Vec<odgi::Edge> graph_get_successors(const odgi::graph_t& graph, uint64_t node_id);
rust::Vec<odgi::Edge> graph_get_predecessors(const odgi::graph_t& graph, uint64_t node_id);
rust::Vec<rust::String> graph_get_paths_on_node(const odgi::graph_t& graph, uint64_t node_id);
uint64_t graph_get_path_length(const odgi::graph_t& graph, rust::Str path_name);
int64_t graph_get_next_node_on_path(const odgi::graph_t& graph, rust::Str path_name, uint64_t node_id);

rust::Vec<rust::String> graph_get_paths_on_edge(
    const odgi::graph_t& graph,
    uint64_t from_node, bool from_orient,
    uint64_t to_node, bool to_orient
);