Struct dlsite::DlsiteClient
source · pub struct DlsiteClient { /* private fields */ }Expand description
API client for DLsite.
Implementations§
source§impl DlsiteClient
impl DlsiteClient
sourcepub async fn get_products_ajax(
&self,
product_ids: Vec<&str>
) -> Result<HashMap<String, ProductAjax>, DlsiteError>
pub async fn get_products_ajax( &self, product_ids: Vec<&str> ) -> Result<HashMap<String, ProductAjax>, DlsiteError>
Get the AJAX data of multiple products.
sourcepub async fn get_product_ajax(
&self,
product_id: &str
) -> Result<ProductAjax, DlsiteError>
pub async fn get_product_ajax( &self, product_id: &str ) -> Result<ProductAjax, DlsiteError>
Get the AJAX data of a product.
source§impl DlsiteClient
impl DlsiteClient
sourcepub async fn get_product_html(
&self,
product_id: &str
) -> Result<ProductHtml, DlsiteError>
pub async fn get_product_html( &self, product_id: &str ) -> Result<ProductHtml, DlsiteError>
Get and parse the HTML page of a product.
source§impl DlsiteClient
impl DlsiteClient
sourcepub async fn get_product_review(
&self,
product_id: &str,
limit: u32,
page: u32,
mix_pickup: bool,
order: ReviewSortOrder
) -> Result<ProductReview, DlsiteError>
pub async fn get_product_review( &self, product_id: &str, limit: u32, page: u32, mix_pickup: bool, order: ReviewSortOrder ) -> Result<ProductReview, DlsiteError>
Get product reviews and related informations.
Arguments
product_id- Product ID.mix_pickup- Mixes picked up review. To get user genre, this must be true.order- Sort order of reviews.limit- Number of reviews to get.page- Page number.
Returns
ProductReview- Product reviews and related informations.
source§impl DlsiteClient
impl DlsiteClient
sourcepub async fn get_product(
&self,
product_id: &str
) -> Result<Product, DlsiteError>
pub async fn get_product( &self, product_id: &str ) -> Result<Product, DlsiteError>
Get information about a product (also called “work”). This function will make 3 requests to DLsite: one to get the HTML page, one to get the AJAX data and one to get the review data. Especially, review data can be used as independent information.
Arguments
product_id- The product ID to get information about. Example:RJ123456. NOTE: This must be capitalized.
Example
use dlsite::{DlsiteClient, product::Product};
use tokio;
#[tokio::main]
async fn main() {
let client = DlsiteClient::default();
let product = client.get_product("RJ123456").await.unwrap();
println!("{:#?}", product);
}source§impl DlsiteClient
impl DlsiteClient
Trait Implementations§
source§impl Clone for DlsiteClient
impl Clone for DlsiteClient
source§fn clone(&self) -> DlsiteClient
fn clone(&self) -> DlsiteClient
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Default for DlsiteClient
impl Default for DlsiteClient
source§fn default() -> DlsiteClient
fn default() -> DlsiteClient
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for DlsiteClient
impl Send for DlsiteClient
impl Sync for DlsiteClient
impl Unpin for DlsiteClient
impl !UnwindSafe for DlsiteClient
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more