pub struct Engine { /* private fields */ }Expand description
High-level workflow engine for Anki operations.
The engine wraps an AnkiClient and provides access to workflow modules
that combine multiple API calls into cohesive operations.
§Example
use ankit_engine::Engine;
// Create with default client settings
let engine = Engine::new();
// Or with a custom client
let client = ankit_engine::AnkiClient::builder()
.url("http://localhost:8765")
.build();
let engine = Engine::from_client(client);
// Access workflow modules
let stats = engine.analyze().study_summary("Default", 7).await?;Implementations§
Source§impl Engine
impl Engine
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new engine with default client settings.
Connects to AnkiConnect at http://127.0.0.1:8765.
Sourcepub fn from_client(client: AnkiClient) -> Self
pub fn from_client(client: AnkiClient) -> Self
Create an engine from an existing client.
Sourcepub fn client(&self) -> &AnkiClient
pub fn client(&self) -> &AnkiClient
Get a reference to the underlying client.
Use this for direct API access when workflows don’t cover your use case.
Sourcepub fn import(&self) -> ImportEngine<'_>
pub fn import(&self) -> ImportEngine<'_>
Access import workflows.
Provides bulk import with duplicate detection and conflict resolution.
Sourcepub fn export(&self) -> ExportEngine<'_>
pub fn export(&self) -> ExportEngine<'_>
Access export workflows.
Provides deck export and review history extraction.
Sourcepub fn organize(&self) -> OrganizeEngine<'_>
pub fn organize(&self) -> OrganizeEngine<'_>
Access organization workflows.
Provides deck cloning, merging, and tag-based reorganization.
Sourcepub fn analyze(&self) -> AnalyzeEngine<'_>
pub fn analyze(&self) -> AnalyzeEngine<'_>
Access analysis workflows.
Provides study statistics and problem card (leech) detection.
Sourcepub fn migrate(&self) -> MigrateEngine<'_>
pub fn migrate(&self) -> MigrateEngine<'_>
Access migration workflows.
Provides note type migration with field mapping.
Sourcepub fn media(&self) -> MediaEngine<'_>
pub fn media(&self) -> MediaEngine<'_>
Access media workflows.
Provides media audit and cleanup operations.
Sourcepub fn progress(&self) -> ProgressEngine<'_>
pub fn progress(&self) -> ProgressEngine<'_>
Access progress management workflows.
Provides card state management, performance tagging, and bulk operations.
Sourcepub fn enrich(&self) -> EnrichEngine<'_>
pub fn enrich(&self) -> EnrichEngine<'_>
Access enrichment workflows.
Provides tools for finding notes with empty fields and updating them.
Sourcepub fn deduplicate(&self) -> DeduplicateEngine<'_>
pub fn deduplicate(&self) -> DeduplicateEngine<'_>
Access deduplication workflows.
Provides duplicate detection and removal based on key fields.
Sourcepub fn backup(&self) -> BackupEngine<'_>
pub fn backup(&self) -> BackupEngine<'_>
Access backup and restore workflows.
Provides deck backup to .apkg files and restore operations.
Sourcepub fn search(&self) -> SearchEngine<'_>
pub fn search(&self) -> SearchEngine<'_>
Access content search helpers.
Provides simplified search methods that return full note info instead of just IDs, abstracting away Anki query syntax.
§Example
let engine = Engine::new();
// Search for text in any field
let notes = engine.search().text("conjugation", Some("Japanese")).await?;
// Search in a specific field
let notes = engine.search().field("Front", "hello", None).await?;