Expand description
Low-level FFI bindings to the YARA read mapper C++ shim.
This crate compiles a C++ shim layer that wraps YARA’s SeqAn2-based template code and exposes a C-compatible API for loading FM indices, ingesting reads, and retrieving alignment results as flat structs.
Structs§
- Yara
Alignment Record - A single alignment record returned by the mapper.
- Yara
Indexer Handle - Opaque handle to a YARA Indexer instance.
Allocated and owned by the C++ side; freed via
yara_indexer_close. - Yara
Indexer Options - Indexer configuration passed to
yara_indexer_build. - Yara
Mapper Handle - Opaque handle to a fully-configured YARA Mapper instance.
Allocated and owned by the C++ side; freed via
yara_mapper_close. - Yara
Mapper Options - Mapper configuration passed to
yara_mapper_open. - Yara
Read Batch - A batch of paired-end reads to map.
Functions§
- yara_
indexer_ ⚠build - Build an FM index from a FASTA file. Returns null on error, with
error_bufpopulated. - yara_
indexer_ ⚠close - Free the indexer handle and all associated memory.
- yara_
indexer_ ⚠contig_ count - Number of contigs in the built index.
- yara_
indexer_ ⚠contig_ length - Length of the contig at
idx. - yara_
indexer_ ⚠contig_ name - Name of the contig at
idx. The returned pointer is valid for the lifetime of the handle. - yara_
mapper_ ⚠close - Free the mapper and all associated memory.
- yara_
mapper_ ⚠contig_ count - Number of reference contigs in the loaded index.
- yara_
mapper_ ⚠contig_ length - Length of the contig at
idx. - yara_
mapper_ ⚠contig_ name - Name of the contig at
idx. The returned pointer is valid for the lifetime of the handle. - yara_
mapper_ ⚠free_ record - Free a single record’s C++-owned memory (cigar, seq, qual, xa).
- yara_
mapper_ ⚠free_ records - Free a record batch’s C++-owned memory (cigar arrays, seq/qual strings, XA strings). Must be called after processing each batch.
- yara_
mapper_ ⚠map_ paired - Map a batch of paired-end reads. Returns the number of output records
written to
out, or -1 on error. - yara_
mapper_ ⚠open - Create a mapper and load the FM index. Returns null on error, with
error_bufpopulated.