anki_bridge 0.10.2

AnkiBridge is a Rust library that provides a bridge between your Rust code and the Anki application, enabling HTTP communication and seamless data transmission.
Documentation
/*
* The MIT License (MIT)
*
* Copyright (c) 2023 DaniƩl Kerkmann <daniel@kerkmann.dev>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/

/// Answers cards.
///
/// Ease ranges from 1 (Again), to 2 (Hard), 3 (Good) and 4 (Easy).
/// Will start the timer immediately before answering.
/// Returns `true` if the card exists, `false` otherwise.
pub mod answer_cards;

/// Checks for overdue cards.
///
/// Returns an array indicating whether each of the given cards is due (in the same order).
///
/// Note: cards in the learning queue with a large interval (over 20 minutes) are treated as not due until the time of their interval has passed, to match the way Anki treats them when reviewing.
pub mod are_due;

/// Checks for suspended cards.
///
/// Returns an array indicating whether each of the given cards is suspended (in the same order).
/// If the card doesn't exist, the value in the array will be `null`.
pub mod are_suspended;

/// Gets card info.
///
/// The info fetched includes CSS, note type, the note that the card belongs to, and deck name, last modification timestamp, as well as ease and interval.
pub mod cards_info;

/// Gets card modification times.
///
/// This function is about 15 times faster than executing [cards_info].
pub mod cards_mod_time;

/// Gets all notes related to a card.
///
/// The returned list is unsorted.
/// If multiple cards share the same note, the note ID will only show up once in the array.
pub mod cards_to_notes;

/// Finds cards that match a query.
///
/// Functionally identical to [gui_browse] but doesn't use the GUI for better performance.
///
/// [gui_browse]: crate::graphical_actions::gui_browse
pub mod find_cards;

/// Forgets cards, making the cards new again.
pub mod forget_cards;

/// Gets a card's ease factors.
///
/// Returns an array with the ease factor for each of the given cards (in the same order).
pub mod get_ease_factors;

/// Gets a card's most recent intervals, in seconds.
///
/// Returns an array of the most recent intervals for each given card ID.
/// Negative intervals are in seconds and positive intervals in days.
pub mod get_intervals;

/// Gets a card's complete list of intervals, in seconds.
///
/// Returns an array of the most recent intervals for each given card ID, or a 2-dimensional array of all the intervals for each given card ID when `complete` is `true`.
/// Negative intervals are in seconds and positive intervals in days.
pub mod get_intervals_alternative;

/// Marks cards as "relearning".
pub mod relearn_cards;

/// Sets a card's due date.
///
/// Turns cards into review cards if they are new, and makes them due on a certain date.
/// - 0 = today
/// - 1! = tomorrow + change interval to 1
/// - 3-7 = random choice of 3-7 days
pub mod set_due_date;

/// Sets a card's ease factor.
///
/// Returns `true` if successful (all cards existed) or `false` otherwise.
pub mod set_ease_factors;

/// Sets a card's specific value.
///
/// Given the risk of wreaking havoc in the database when changing some values of a card, some keys require the argument "`warning_check`" set to `true`.
/// This can be used to set a card's flag, change its ease factor, change the review order in a filtered deck and change the column "data", and many other values.
/// A list of values and explanation of their respective utility can be found at
/// [AnkiDroid's wiki][anki-db-doc].
///
/// [anki-db-doc]: https://github.com/ankidroid/Anki-Android/wiki/Database-Structure
pub mod set_specific_value_of_card;

/// Suspends cards.
///
/// Returns `true` if successful (at least one card wasn't already suspended) or `false` otherwise.
pub mod suspend;

/// Checks if a card is suspended.
///
/// Returns `true` if suspended, `false` otherwise.
pub mod suspended;

/// Unsuspends cards.
///
/// Returns `true` if successful (at least one card was previously suspended) or `false` otherwise.
pub mod unsuspend;