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_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};
use tokio;
#[tokio::main]
async fn main() {
let client = DlsiteClient::new().unwrap();
let product = client.get_product("RJ123456").await.unwrap();
println!("{:#?}", product);
}source§impl DlsiteClient
impl DlsiteClient
Trait Implementations§
source§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