Skip to main content

rbp_core/dto/
response.rs

1use serde::{Deserialize, Serialize};
2use std::collections::BTreeMap;
3
4#[derive(Debug, Serialize, Deserialize)]
5pub struct ApiSample {
6    pub obs: String,
7    pub abs: String,
8    pub equity: f32,
9    pub density: f32,
10    pub distance: f32,
11}
12
13#[derive(Debug, Serialize, Deserialize)]
14pub struct ApiDecision {
15    pub edge: String,
16    pub mass: f32,
17}
18
19#[derive(Debug, Serialize, Deserialize)]
20pub struct ApiStrategy {
21    pub history: i64,
22    pub present: i16,
23    pub choices: i64,
24    pub accumulated: BTreeMap<String, f32>,
25    pub counts: BTreeMap<String, u32>,
26}
27
28// NOTE: impl From<Strategy> for ApiStrategy is in rbp-nlhe
29// NOTE: impl From<Decision<Edge>> for ApiDecision is in rbp-nlhe
30// NOTE: impl From<tokio_postgres::Row> for ApiSample is in rbp-nlhe or rbp-database
31// NOTE: impl From<tokio_postgres::Row> for Decision<Edge> is in rbp-nlhe or rbp-database