blackjack/enums/mod.rs
1//! Enums to be used throughout the crate.
2use serde::{Serialize, Deserialize};
3use crate::prelude::*;
4
5/// Possible DType returns, matches [`BlackJackData`]
6#[derive(Debug, PartialEq, Clone, Deserialize, Serialize, PartialOrd)]
7pub enum DType {
8 /// `f64`
9 F64,
10
11 /// `i64`
12 I64,
13
14 /// `f32`
15 F32,
16
17 /// `i32`
18 I32,
19
20 /// `String`
21 STRING,
22}
23
24/// Container for use with `Row` struct
25#[derive(PartialEq)]
26pub enum Datum<'a> {
27 /// Refrence to a f64 within the dataframe
28 F64(&'a f64),
29
30 /// Refrence to a i64 within the dataframe
31 I64(&'a i64),
32
33 /// Refrence to a f32 within the dataframe
34 F32(&'a f32),
35
36 /// Refrence to a i32 within the dataframe
37 I32(&'a i32),
38
39 /// Refrence to a String within the dataframe
40 STR(&'a String),
41}
42
43/// An enum representation of a `Series`, typically only seen
44/// when trying to get a reference to a column/`Series` from a
45/// `DataFrame` without knowing its type beforehand.
46pub enum Column {
47 /// A column in the `DataFrame` of type `Series<f64>`
48 F64(Series<f64>),
49
50 /// A column in the `DataFrame` of type `Series<i64>`
51 I64(Series<i64>),
52
53 /// A column in the `DataFrame` of type `Series<f32>`
54 F32(Series<f32>),
55
56 /// A column in the `DataFrame` of type `Series<i32>`
57 I32(Series<i32>),
58
59 /// A column in the `DataFrame` of type `Series<String>`
60 STR(Series<String>),
61}