Skip to main content

px_native/domain/
native_solver.rs

1use async_trait::async_trait;
2use px_core::{Fingerprint, PxAppId, PxCookieBundle};
3use px_errors::AppError;
4
5#[derive(Debug, Clone)]
6pub struct SolveContext {
7    pub url: String,
8    pub app_id: PxAppId,
9    pub fingerprint: Fingerprint,
10}
11
12impl SolveContext {
13    pub fn new(url: impl Into<String>, app_id: PxAppId, fingerprint: Fingerprint) -> Self {
14        Self {
15            url: url.into(),
16            app_id,
17            fingerprint,
18        }
19    }
20}
21
22#[async_trait]
23pub trait NativeSolver: Send + Sync {
24    async fn solve(&self, ctx: &SolveContext) -> Result<PxCookieBundle, AppError>;
25}