diff options
| author | A Farzat <a@farzat.xyz> | 2026-03-02 10:05:46 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-03-02 11:27:12 +0300 |
| commit | 98532dc37ae9f72e8970d8d67e6bab9545596650 (patch) | |
| tree | 28b9f133106354c64101073180319105bc39fd2a /src/models.rs | |
| parent | c6ffa62423659cf7d82802b9e0343f149c780de3 (diff) | |
| download | oreilly-epub-98532dc37ae9f72e8970d8d67e6bab9545596650.tar.gz oreilly-epub-98532dc37ae9f72e8970d8d67e6bab9545596650.zip | |
Add e-book metadata fetching
Diffstat (limited to 'src/models.rs')
| -rw-r--r-- | src/models.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/src/models.rs b/src/models.rs new file mode 100644 index 0000000..77afeb2 --- /dev/null +++ b/src/models.rs @@ -0,0 +1,25 @@ +use serde::Deserialize; + +// --- Models for the Search API --- + +#[derive(Debug, Deserialize)] +pub struct SearchResponse { + pub results: Vec<SearchResult>, +} + +#[derive(Debug, Deserialize)] +pub struct SearchResult { + pub title: String, + pub authors: Vec<String>, + pub publishers: Vec<String>, + pub cover_url: String, +} + +// --- Models for the EPUB API --- + +#[derive(Debug, Deserialize)] +pub struct EpubResponse { + pub publication_date: String, + pub chapters: String, // This is a URL to the chapters list + pub files: String, // This is a URL to the resource files +} |
