9 releases

new 0.2.0 Jan 26, 2025
0.1.7 Jan 15, 2025
0.1.4 Dec 21, 2024
0.1.2 Nov 28, 2024

#1452 in Web programming

Download history 359/week @ 2024-11-26 137/week @ 2024-12-03 4/week @ 2024-12-10 109/week @ 2024-12-17 7/week @ 2024-12-24 119/week @ 2024-12-31 164/week @ 2025-01-07 136/week @ 2025-01-14 90/week @ 2025-01-21

509 downloads per month

MIT license

100KB
3K SLoC

vn

[dependencies]
vn = 0.2

Usage

Create a new VNDB client:

use vn::Vndb;
use std::time::Duration;

let vndb = Vndb::builder()
  .max_concurrent_requests(5)
  .timeout(Duration::from_secs(10))
  .token("abcd-efghi-jklmn-opqrs-tuvx-z1234-5678")
  .user_agent("the-user-agent/v5.0")
  .build();

Find a visual novel by its id:

use vn::{Vndb, VisualNovelField};

let vndb = Vndb::new();
let results = vndb
  .find_visual_novel(1194)
  .fields(VisualNovelField::Title)
  .send()
  .await
  .unwrap()
  .results;

let visual_novel = results.first().unwrap();
let title = visual_novel.title.as_deref().unwrap();
assert!(title.eq_ignore_ascii_case("Yosuga no Sora"));

Search characters by their name:

use vn::{Vndb, CharacterField, SortCharacterBy};

let vndb = Vndb::new();
let results = vndb
  .search_character("Minazuki Shigure")
  .fields([CharacterField::Name, CharacterField::Original])
  .results(10)
  .sort(SortCharacterBy::Name)
  .send()
  .await
  .unwrap()
  .results;

let character = results.first().unwrap();
let name = character.name.as_deref().unwrap();
let original = character.original.as_deref().unwrap();

assert!(name.eq_ignore_ascii_case("Minazuki Shigure"));
assert_eq!(original, "水無月 時雨");

Dependencies

~8–20MB
~273K SLoC