Expand description
Error types for the ankit crate.
This module provides error handling for AnkiConnect operations.
§Error Handling
The most common errors you’ll encounter are:
Error::ConnectionRefused: Anki is not running or AnkiConnect is not installedError::AnkiConnect: The operation failed (e.g., deck not found, invalid query)Error::PermissionDenied: API key required or request needs approval
§Example
use ankit::{AnkiClient, Error};
let client = AnkiClient::new();
match client.decks().names().await {
Ok(decks) => println!("Found {} decks", decks.len()),
Err(Error::ConnectionRefused) => {
eprintln!("Please start Anki with AnkiConnect installed");
}
Err(Error::PermissionDenied) => {
eprintln!("Please configure your API key or approve the request in Anki");
}
Err(e) => eprintln!("Error: {}", e),
}Enums§
- Error
- The error type for AnkiConnect operations.
Type Aliases§
- Result
- A specialized Result type for AnkiConnect operations.