Skip to main content

Crate ankit_engine

Crate ankit_engine 

Source
Expand description

High-level workflow operations for Anki via AnkiConnect.

This crate provides ergonomic, high-level operations built on top of the ankit client library. While ankit provides 1:1 API bindings, ankit-engine combines multiple API calls into cohesive workflows.

§Quick Start

use ankit_engine::Engine;

let engine = Engine::new();

// High-level workflows
let stats = engine.analyze().study_summary("Japanese", 30).await?;
println!("Cards reviewed: {}", stats.total_reviews);

// Direct client access when needed
let version = engine.client().misc().version().await?;

§Feature Flags

All workflow modules are enabled by default. Disable with:

[dependencies]
ankit-engine = { version = "0.1", default-features = false, features = ["analyze"] }

Available features:

  • import - Bulk import with duplicate handling
  • export - Deck and review history export
  • organize - Deck cloning, merging, reorganization
  • analyze - Study statistics and problem card detection
  • migrate - Note type migration with field mapping
  • media - Media audit and cleanup
  • progress - Card state management and performance tagging
  • enrich - Find and update notes with empty fields
  • deduplicate - Duplicate detection and removal
  • backup - Deck backup and restore to .apkg files
  • search - Content search helpers (always enabled)

Modules§

analyze
Study statistics and problem card detection.
backup
Backup and restore workflows for Anki decks.
deduplicate
Duplicate note detection and removal.
enrich
Note enrichment operations.
export
Deck and review history export operations.
import
Bulk import operations with duplicate handling.
media
Media audit and cleanup operations.
migrate
Note type migration operations.
organize
Deck organization operations.
progress
Progress management and card state operations.
search
Content search helpers for finding notes.

Structs§

AnkiClient
The main client for interacting with AnkiConnect.
CanAddResult
Result of checking if a note can be added.
CardAnswer
Answer for a card review.
CardInfo
Information about a card.
CardModTime
Modification time information for a card.
CardTemplate
Card template for a model (used in responses from modelTemplates).
ClientBuilder
Builder for creating a customized AnkiClient.
CreateModelParams
Parameters for creating a new model.
DeckConfig
Configuration for a deck.
DeckStats
Statistics for a deck.
Engine
High-level workflow engine for Anki operations.
FieldFont
Font information for a field.
FindReplaceParams
Parameters for find and replace in models.
LapseConfig
Configuration for lapses.
MediaAttachment
A media attachment for a note (audio, video, or picture).
ModelField
Field information for a model.
ModelStyling
Model styling information.
NewCardConfig
Configuration for new cards.
Note
A new note to be added to Anki.
NoteBuilder
Builder for creating notes with a fluent API.
NoteField
A field value with metadata.
NoteInfo
Information about an existing note.
NoteModTime
Modification time information for a note.
NoteOptions
Options for adding notes.
ReviewConfig
Configuration for reviews.
StoreMediaParams
Parameters for storing a media file.

Enums§

DuplicateScope
Scope for duplicate note checking.
Ease
Answer ease for reviewing cards.
Error
Errors that can occur during engine operations.

Type Aliases§

Result
Result type for ankit-engine operations.