Skip to main content

Crate yara_mapper_sys

Crate yara_mapper_sys 

Source
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§

YaraAlignmentRecord
A single alignment record returned by the mapper.
YaraIndexerHandle
Opaque handle to a YARA Indexer instance. Allocated and owned by the C++ side; freed via yara_indexer_close.
YaraIndexerOptions
Indexer configuration passed to yara_indexer_build.
YaraMapperHandle
Opaque handle to a fully-configured YARA Mapper instance. Allocated and owned by the C++ side; freed via yara_mapper_close.
YaraMapperOptions
Mapper configuration passed to yara_mapper_open.
YaraReadBatch
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_buf populated.
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_buf populated.