Skip to main content

Crate jmdict_fast_ffi

Crate jmdict_fast_ffi 

Source
Expand description

FFI-agnostic facade over jmdict-fast.

This crate intentionally exposes only the shapes that every popular Rust FFI generator can describe: owned data, concrete enums, Arc<Self> handles, no lifetimes, no generics, no iterators across the boundary. The generator crates (jmdict-fast-uniffi, jmdict-fast-frb, jmdict-fast-bolt, …) describe these types externally (UDL, FRB scan, bolt IDL) and add their own scaffolding — they should not need to reach into jmdict-fast itself.

§Differences from jmdict-fast

  • Dict::load / load_default return Arc<Self> (every generator requires Arc for object handles).
  • The chainable QueryBuilder collapses into a QueryOptions record so callers in foreign languages don’t need fluent chaining.
  • JmdictError::IoError(std::io::Error) collapses into Error::Io { message } so the error survives codegen — io::Error is not FFI-safe.
  • Iterators (iter_entries) become an explicit (start, count) pagination.

§Re-exports

Data types (Entry, KanjiEntry, Xref, …) are re-exported unchanged from jmdict-fast. They are already plain POD with public fields and no lifetimes — every FFI generator can describe them as records.

Structs§

BatchResult
Per-term batch result, paired with the original term so callers can correlate output without relying on input order.
DataVersion
Dictionary data version information.
DeinflectionInfo
Information about how a term was deinflected to find its base form.
Dict
FFI-friendly handle around a loaded dictionary. Construct via Dict::load or Dict::load_default; the resulting Arc<Dict> can be shared freely across threads and FFI calls.
Entry
GlossEntry
KanaEntry
KanjiEntry
LanguageSource
LookupResult
A single dictionary lookup hit.
QueryOptions
Options for Dict::lookup_with_options / Dict::lookup_batch.
SenseEntry
Xref

Enums§

Error
Errors surfaced across the FFI boundary.
MatchMode
The search mode for a query.
MatchType
How a lookup result matched the query term.